MulaiMulai sekarang secara gratis

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.

Latihan ini adalah bagian dari kursus

Introduction to Docker

Lihat Kursus

Latihan interaktif praktis

Ubah teori menjadi tindakan dengan salah satu latihan interaktif kami.

Mulai berolahraga