Building Docker Images
app
image
containers
registry
Imperative
Declarative
VM Like
Dockerfile
(manual)
(automated)
registry
image
image
intermediate container
code
cp
build
commit
pull
run
push
pull image
run container
copy source code
build/compile
commit
push
dockerfile
FROM
RUN
COPY
EXPOSE
CMD
dockerfile
FROM
RUN
COPY
EXPOSE
CMD
docker build
image
http://hub.docker.com
http://store.docker.com
sign up
vote ui
redis
worker
db
results
Java App
Maven
https://github.com/schoolofdevops/voting-app-worker
registry
centos
install jdk
install mvn
mvn compile
mvn
mvn compile
https://gist.github.com/initcron/f35f7854a8176374a48963ed8aae0b8e
https://github.com/schoolofdevops/voting-app-worker
registry
mvn
mvn
intermediate container
code
cp
build
commit
pull
run
artifact
host
registry
java
java
intermediate container
artifact
cp
commit
pull
run
push
host
user/app:v2
FROM microsoft/dotnet-samples:aspnetapp
WORKDIR /app
RUN mkdir C:\site
ENTRYPOINT ["cmd"]
docker image build -t <dockrhub user id>/app:v2 .
docker image ls
dot (current directory)
docker container run -idt --name workertest2 <dockrhub user id>/app:v2
docker container ls
docker logs workertest2
docker image tag <dockrhub user id>/app:v2 <dockrhub user id>/app:latest
docker image ls
docker image push <dockrhub user id>/app:latest
docker image push <dockrhub user id>/app
docker image push <dockrhub user id>/app:latest
docker image push <dockrhub user id>/app