-
Dockerfile
: recipe for building your immutable image
FROM debian:jessie
LABEL Maintainer="Damien DUPORTAL"
RUN apt-get update && apt-get install -y nginx
VOLUME ["/tmp","/app"]
EXPOSE 80
ENTRYPOINT ["/usr/sbin/nginx"]
CMD ["-g","daemon off;"]
-
Using GitServer, from the repository root
-
Check the
Dockerfile
content
-
-
Using Devbox, from the demoapp work directory’s root
-
Checking images with
docker images
-
Build an image named
demoapp:latest
-
Check again images
-
-
Check running containers with
docker ps
-
Run and test the container with this command:
docker run -p {demo-docker-port}:8080 -d my_image:1.0.0 # Then open http://{external-domain}:{demo-docker-port}[]
-
Check again running containers with
docker ps
-
Stop it with
docker stop <Container ID>
-
Check again running containers with
docker ps
-
It is a lot of command !
-
What about testing the Docker Image ?
-
The demoapp contains a testing system:
-
It use Bats
-
Files:
./src/test/bats/*.bats
-
Command:
-
/usr/local/bin/bats ./src/test/bats/docker.bats