Anton Rand
Anton Rand

Reputation: 342

Extend Existing Docker Image

I've pulled the teamcity-agent image from:

https://hub.docker.com/r/jetbrains/teamcity-agent/

I've installed Subversion and Node on top of this image and commited it back to Docker Hub by editing the existing image -

https://hub.docker.com/r/antonrand/teamcity-agent/

Now I'd like to extend the image - just by adding another mount point. This is my Dockerfile:

FROM antonrand/teamcity-agent

# Create build directory
RUN mkdir -p /usr/src/test

VOLUME /usr/src/test

WORKDIR /usr/src/test

When I run this nothing happens, how can I tell Docker to run the CMD command which is already set up in the official image? They haven't published their Dockerfile so I don't know what to run.

Thank you for the help :)

Upvotes: 0

Views: 464

Answers (2)

user2915097
user2915097

Reputation: 32176

They have not published their Dockerfile, but you can reverse engineer it with https://github.com/CenturyLinkLabs/dockerfile-from-image

At the very least, a docker history teamcity-agent should show it

Upvotes: 1

Tim D
Tim D

Reputation: 508

Assuming neither of your Docker additions changed the CMD or ENTRYPOINT of the image, you should be able to execute it the same way as the original teamcity image. The command is shown in their documentation on DockerHub:

docker run -it -e SERVER_URL="<url to TeamCity server>"  \ 
-v <path to agent config folder>:/data/teamcity_agent/conf  \      
<new-image-name>

where new-image-name is the new docker image you created with your second Dockerfile.

Upvotes: 3

Related Questions