But you can hardly find a manual how to build your own docker container without pulling everything from a foreign repository.
Why should you not pull everything from foreign repositories?
You should read this article or this:
But since each phase of the development pipeline is built at a different time, …That is a good point.
…you can’t be sure that the same version of each dependency in the development version also got into your production version.
As considered in this article you can put some more constraints into your docker file:
FROM ubuntu:14.04.or even
FROM ubuntu:0bf3461984f2fb18d237995e81faa657aff260a52a795367e6725f0617f7a56cAnd that is the point where i tell you: Create a process to build your own docker containers from scratch and distribute them with your own repository or copy them to all your docker nodes (s. here)
So here the steps to create your own container from a local directory (here ncweb):
The Dockerfile contains the following:
# ls -l ncweb/ total 12 -rw-r--r-- 1 root root 90 Nov 26 10:06 Dockerfile -rw-r--r-- 1 root root 255 Nov 26 11:29 index.html -rw-r--r-- 1 root root 0 Nov 26 11:29 logfile -rwxr--r-- 1 root root 176 Nov 26 11:29 ncweb.sh
Into this directory you have to put everything you need, e.g. a complete JDK or your binaries or ...# ls -l ncweb/ alpine:~# cat ncweb/Dockerfile FROM alpine WORKDIR /tmp RUN mkdir ncweb ADD . /tmp ENTRYPOINT [ "/tmp/ncweb.sh" ]
And then change into this directory and build your container:
The distribution to other docker nodes can be done like this:ncweb# docker build -t ncweb:0.2 .
For more details read this posting.# docker save ncweb:0.3 | ssh 192.168.178.47 docker load
Related posts:
- Docker on Ubuntu
- Running through a tutorial / investigating the processes
- Creating a small linux for my docker cluster (Alpine Linux)
- How to build a docker swarm
- Creating a minimal webserver container and deploying it to docker swarm
- Setting up a tomcat with docker
- Running a swarm with multiple managers
- Mysql inside a docker container - persistency with docker volumes
- How to change the configuration of a standard docker container(e.g. changing tomcats memory settings)
No comments:
Post a Comment