https://github.com/mfellner/build-container
Demonstration how to create a minimal runtime-container with Docker by utilizing a build-container.
https://github.com/mfellner/build-container
Last synced: 2 months ago
JSON representation
Demonstration how to create a minimal runtime-container with Docker by utilizing a build-container.
- Host: GitHub
- URL: https://github.com/mfellner/build-container
- Owner: mfellner
- Created: 2015-06-13T14:02:53.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-06-13T14:04:55.000Z (almost 10 years ago)
- Last Synced: 2024-10-12T00:17:59.896Z (8 months ago)
- Language: Clojure
- Size: 117 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Build-container
This project demonstrates how to create a minimal runtime-container with Docker
by utilizing a build-container.* ./Dockerfile contains the configuration for the build-container.
* ./docker/Dockerfile contains the configuration for the runtime-container.**The container images can be built and run in two ways:**
./build.sh
docker run -p 8080:8080 mfellner/hello-clojureThis way, the build-container installs the necessary build-chain and then
uses docker to build the runtime-container image. This is possible by mapping
the docker.sock of the host into the container using `-v /var/run/docker.sock:/var/run/docker.sock`.It would also be possible to map the docker-client binary this way.
**Or with Docker Compose:**
docker-compose up
When using this method, the runtime-container image is actually built by Docker Compose
but the volume of the build-container, containing the application artifact, is mapped
into the runtime container.#### Notes
* In order to support both the manual build and Docker Compose, the two Dockerfiles
need to be located in separate directories. Furthermore, the directory "docker/", which
contains the configuration for the runtime-container, needs to be used as a `WORKDIR`
in both containers and must be used as a `VOLUME` on the build-container.
* Automated builds on Docker Hub are not supported (but you could use a CI service instead).## License
Copyright © 2015 Maximilian Fellner