Skip to content
This repository was archived by the owner on Oct 10, 2020. It is now read-only.

Append command to container run method when container is not running.#110

Merged
rhatdan merged 1 commit intoprojectatomic:masterfrom
rhatdan:run
Aug 10, 2015
Merged

Append command to container run method when container is not running.#110
rhatdan merged 1 commit intoprojectatomic:masterfrom
rhatdan:run

Conversation

@rhatdan
Copy link
Member

@rhatdan rhatdan commented Aug 7, 2015

We have two cases when calling atomic run, In one case the container
exists and we will just execute the COMMAND into the container.

If the container is not running, we want to append the COMMAND onto the
container RUN method, to allow more complex interaction.

For example if i had container image TEST that had the run label:

LABEL RUN="docker run -ti ${IMAGE} command"

atomic run TEST -h

Would execute

docker run -ti ${IMAGE} command -h

Displaying help information about the container.

@rhatdan
Copy link
Member Author

rhatdan commented Aug 7, 2015

@aweiteka Does this work for you?

@willmtemple @cgwalters @sctweedie Please review.

@aweiteka
Copy link
Contributor

aweiteka commented Aug 8, 2015

@rhatdan that's it. Simple as that. Thanks.

@willmtemple
Copy link

@rhatdan I checked this out locally for tests, and I'm getting an error in install. This is confusing to me because I don't think you touched the install code in this PR, but I do not get the following error on master.

++ /usr/bin/coverage run --source=./Atomic/ --branch --append atomic install --display -n TEST2 atomic-test-1
Traceback (most recent call last):
  File "atomic", line 309, in <module>
    sys.exit(args.func())
  File "Atomic/atomic.py", line 597, in install
    self.display(cmd)
UnboundLocalError: local variable 'cmd' referenced before assignment

It looks like the error is that this PR doesn't include #109, but GitHub hasn't figured out that this branch is out-of date. I think if you merge changes from master into this PR it should be good.

We have two cases when calling atomic run, In one case the container
exists and we will just execute the COMMAND into the container.

If the container is not running, we want to append the COMMAND onto the
container RUN method, to allow more complex interaction.

For example if i had container image TEST that had the run label:

LABEL RUN="docker run -ti \${IMAGE} command"

atomic run TEST -h

Would execute

docker run -ti \${IMAGE} command -h

Displaying help information about the container.
@rhatdan
Copy link
Member Author

rhatdan commented Aug 10, 2015

@willmtemple Please check it again. Docker is hosed up on my machine right now, so I can not test. I don't see this happening with the current code.

@willmtemple
Copy link

@rhatdan LGTM

rhatdan added a commit that referenced this pull request Aug 10, 2015
Append command to container run method when container is not running.
@rhatdan rhatdan merged commit 78c84ff into projectatomic:master Aug 10, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants