Aan de slagGa gratis aan de slag

Changing behavior when starting a container

Let's see how the ENV Dockerfile instruction works in practice. We've added a Dockerfile to your current working directory with the following instructions:

FROM ubuntu:22.04
ENV NAME=Tim
CMD echo "Hello, my name is $NAME"

The Dockerfile will print a personalized message, Hello, my name is Tim, on startup. Let's see how we can change this personalized message even after building an image from the Dockerfile.

Deze oefening maakt deel uit van de cursus

Introduction to Docker

Cursus bekijken

Praktische interactieve oefening

Zet theorie om in actie met een van onze interactieve oefeningen.

Begin met trainen