Welcome to the coding dojo for Docker. Ready to have fun with whales and containers ?
set the execution policy to bypass for the current session
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\00-prerequisites\setup.ps1
Containers aren't VMs. They offer isolation not virtualization.
The host and container OSs must be the same.
Main Benefits are
- portability
- efficiency
- productivity
- version control
docker run --name hello-world hello-world
What happened ? This is the Dockerfile
FROM scratch
COPY hello /
CMD ["/hello"]
https://hub.docker.com/_/hello-world/
https://github.com/docker-library/hello-world
Here we demonstrate
- how the containers are running (and exiting)
- how to check the list of running containers
- how to check the list of all containers
- how to filter the list
- how to prevent the container to exit immediately
- how to run a container in background
- how to run a rabbitmq container and port forward
- how to check the ports forwarding and logs
Here we explain (simply)
- what are the layers of an image
- how to see them.
- What about passwords ?
the image is the recipe, the container is the cake
Here we build a Dockerfile for the aspnetapp sample We explain
- build, build context, tags
- multistage build
- layers
- FROM inheritance
- CMD vs Entrypoint
We build the image, show docker image ls, run the container locally to test it
Here we push our image to a remote registry.
We demo
- creating a Azure Container Registry
- docker login
- tagging, pushing our image
Let's deploy this container to an Azure Web App
Here we demonstrate the images windows server core / nanoserver
Intro with a cool tip to develop ASP.NET Core Applications in a Container
Here we demonstrate
- mounting a volume in read/write
- mounting a volume in read-only
- share a volume with multiple containers
Here we demonstrate
- starting a few services using a docker-compose.yml
- the usage of Traefik
- wait for it
- (few) words on networking
- (few) words on services and scaling, deployment, resource constraint
- healthcheck
Here we demonstrate
- how to create a secret in docker
- how to mount this secret in a container
- how to access it from an aspnet core app
...
Here we talk about tools such as
- portainer
- docker EE
docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer
First we need to create our agent pool (https://jeromechrist.visualstudio.com/_settings/agentpools?_a=agents&poolId=8)
Second we need to create a Personal Acess Token (PAT) with the following permissions :Agent Pools(read, manage), Build (Read & Execute), Code (Read & Write) m42nwothbdeey2qjjk2vsb5wcg4r45qy2ji2efpxekw77vxzgbsq
docker build . -t agent
docker run --rm -e VSTS_ACCOUNT=jeromechrist -e VSTS_TOKEN=m42nwothbdeey2qjjk2vsb5wcg4r45qy2ji2efpxekw77vxzgbsq -e VSTS_POOL=coding-dojo-docker -e DOTNET_CLI_TELEMETRY_OPTOUT=true agent
Go to Zap folder
docker-compose down
docker-compose build
docker-compose up -d aspnetnetapp
docker-compose up zap
Go to SiteSpeed folder
docker-compose down
docker-compose build
docker-compose up -d aspnetnetapp
docker-compose up sitespeed
A website will be generated in .\sitespeed-result\aspnetapp\ describing the performance of the site.
Please note that results can be aggregated to Graphite / InfluxDb and viewed through Grafana.
Go to RobotFramework folder
docker-compose down
docker-compose build
docker-compose up -d aspnetnetapp
docker-compose up -d chrome
docker-compose up test-gc
Go to ./results/gc
You can iterate on tests just by typing again
docker-compose up test-gc
You can switch to firefox:
docker-compose up -d firefox
docker-compose up test-ff