Skip to content

Run docker containers from a docker container #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
alantrrs opened this issue Dec 16, 2015 · 2 comments
Closed
2 tasks done

Run docker containers from a docker container #1

alantrrs opened this issue Dec 16, 2015 · 2 comments

Comments

@alantrrs
Copy link
Member

  • emp should be a docker container
  • emp should launch and build other containers using the following technique:

From here. The simplest way is to just expose the Docker socket to your CI container, by bind-mounting it with the -v flag.

Simply put, when you start your CI container (Jenkins or other), instead of hacking something together with Docker-in-Docker, start it with:

docker run -v /var/run/docker.sock:/var/run/docker.sock ...

Now this container will have access to the Docker socket, and will therefore be able to start containers. Except that instead of starting "child" containers, it will start "sibling" containers.

If your CI makes use of the Docker binary in scripts, you can include it in your CI image, or bind-mount it from the host was well. Example:

docker run -v /var/run/docker.sock:/var/run/docker.sock \
           -v $(which docker):/bin/docker \
           -ti ubuntu
@alantrrs
Copy link
Member Author

@alantrrs
Copy link
Member Author

alantrrs commented Feb 7, 2016

moved remaining items to separate issues: #8 and #7

@alantrrs alantrrs closed this as completed Feb 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant