Comments (12)
@sctweedie What do you think?
I am not crazy about breaking current behaviour, but I would like a way to differentiate between a RUN Once container, and a run some container multiple times.
atomic run currently handles the rhel-tools container fairly well, although users get confused on the first run. But people building containers to run once and specify a command can get confused.
from atomic.
@riekrh Comment?
from atomic.
I think the original idea was to RUN the initial command for the rhel-tools image and the leave the container around for quick execution of subsequent RUNs (vs. recreating multiple instances of the container - which is not intended - or using --rm - which is slow).
I agree that consistency for --spc is desirable and differentiating between CREATE and RUN is a good idea. But perhaps we need an explicit flag for the re-use existing vs create new instance point?
from atomic.
Maybe the default case should be the simplest one and we should allow containers like rhel-tools to have sufficient freedom to define the create/exec functionality?
from atomic.
I agree - at the end it should be defined in the container, so the end-user
is not exposed to decisions.
On Thu, Jul 9, 2015 at 10:13 AM, Brian Exelbierd [email protected]
wrote:
Maybe the default case should be the simplest one and we should allow
containers like rhel-tools to have sufficient freedom to define the
create/exec functionality?—
Reply to this email directly or view it on GitHub
#75 (comment)
.
from atomic.
@riekrh would you support the proposal above, with the addition that CREATE is not executed if the container is already running?
from atomic.
I think there should be a 'reuse_existing_container' LABEL controlling whether run (and start) will re-create the container.
from atomic.
Can we get a little less awful label.
LABEL shared_container
But the problem is how do we handle existing containers. I guess we could continue to look to see if a container exists, but if the container does not exist and the LABEL shared_container does not exist it just does the run command not the create
from atomic.
On Thu, Jul 9, 2015 at 12:13 PM, Daniel J Walsh [email protected]
wrote:
Can we get a little less awful label.
LABEL shared_container
But the problem is how do we handle existing containers. I guess we could
continue to look to see if a container exists, but if the container does
not exist and the LABEL shared_container does not exist it just does the
run command not the createThat should work for the transition. Can drop it later.
from atomic.
I am not 100% sure we need a label for a shared container. Wouldn't it be enough for the RUN to not include --rm? This assumes that the default isn't trying to support multiple style use cases. Perhaps we could move to this default:
atomic run NAME COMMAND
if container exists verify it is the same version as the image of the same name, if not warning message if container is STOPPED or CREATED if START label run START label and continue else run `docker start NAME` and continue if container is RUNNING if EXEC label EXECUTE EXEC label and return else EXECUTE `docker exec -it NAME [COMMAND] and return if RUN label EXECUTE RUN label and return else cmd = `docker run -i -t --rm --name NAME NAME COMMAND` if SPC cmd also gets `--privileged -v /:/host -v /run:/run -v /etc/loaltime:/etc/loaltime --net=host --ipc=h ost --pid=host -e HOST=/host -e NAME=NAME -e IMAGE=IMAGE` if COMMAND cmd += COMMAND EXECUTE cmd and return
If you need a container that persists you will need to include a custom RUN that either daemonizes the container or doesn't clean it up. rhel-tools does this. We could also just state SPC loses the --rm if we wanted to in the default.
from atomic.
Maybe that is is sufficient. Can someone play through the scenarios?
On Wed, Jul 15, 2015 at 6:43 AM, Brian Exelbierd [email protected]
wrote:
I am not 100% sure we need a label for a shared container. Wouldn't it be
enough for the RUN to not include --rm? This assumes that the default isn't
trying to support multiple style use cases. Perhaps we could move to this
default:atomic run NAME COMMAND
if container exists
verify it is the same version as the image of the same name, if not warning messageif container is STOPPED or CREATED
if START label
run START label and continue
else
rundocker start NAME
and continueif container is RUNNING
if EXEC label
EXECUTE EXEC label and return
else
EXECUTE `docker exec -it NAME [COMMAND] and returnif RUN label
EXECUTE RUN label and return
else
cmd =docker run -i -t --rm --name NAME NAME COMMAND
if SPC
cmd also gets--privileged -v /:/host -v /run:/run -v /etc/loaltime:/etc/loaltime --net=host --ipc=h ost --pid=host -e HOST=/host -e NAME=NAME -e IMAGE=IMAGE
if COMMAND
cmd += COMMAND
EXECUTE cmd and returnIf you need a container that persists you will need to include a custom
RUN that either daemonizes the container or doesn't clean it up. rhel-tools
does this. We could also just state SPC loses the --rm if we wanted to in
the default.—
Reply to this email directly or view it on GitHub
#75 (comment)
.
from atomic.
That seems to work for me. We need @sctweedie to comment on this. When is he back from PTO?
from atomic.
Related Issues (20)
- images retrieve HOT 2
- "error: Some base packages would be replaced" when trying to atomic host upgrade HOT 5
- atomic install crash HOT 3
- Kubelet stats HOT 1
- `atomic install/pull` does not respect registries.insecure HOT 1
- Setup docker image on Debian build
- Can't build on Debian
- "fsetxattr: Operation not supported" when running in a podman container HOT 3
- Failed to mount OverlayFS device
- atomic run with short name will throw error about installing first
- Should this `break` changed to `continue`? HOT 1
- Atomic pull tries to get signature files that don't exist off http sigstore HOT 4
- Best Method to Mount a Windows Share within a Container HOT 8
- Intermittent 'No such file or directory' when using "atomic sign ..."
- Network is unreachable when scanning HOT 1
- Cannot clone on macOS
- Facing issue with dbus dependency
- Install fails with `No such file or directory: '/var/lib/atomic/install.json.lock'` HOT 2
- Installing CentOS atomic host 7 in VM with PXE and UEFI - is that known to work? HOT 2
- Providing build automation and end-user/production container images (https://go.googlesource.com/gollvm/) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atomic.