Use the ARG variable in a RUN instruction

Report a typo

You are working on the Dockerfile shown in the snippet below.

FROM ubuntu:22.04

LABEL author=HyperUser

ARG GREETING
RUN echo $GREETING World! > /tmp/demo.txt

ENTRYPOINT ["cat", "/tmp/demo.txt"]

What is the output when you run a container using the following command?

$ docker build --build-arg GREETING=Hello, -t ubuntu:v1 .
Enter a short text
___

Create a free account to access the full topic