Skip to content

Latest commit

 

History

History
executable file
·
36 lines (22 loc) · 609 Bytes

File metadata and controls

executable file
·
36 lines (22 loc) · 609 Bytes

Basic Dockerfile

Build a basic Dockerfile to create a Docker image.

Objective

Create a basic Dockerfile to create a Docker image.

When this Docker image is run, it shoud print Hello, Captain! to console before exiting.

Dockerfile

FROM alpine:latest

ENV NAME="Captain"

ENTRYPOINT ["sh", "-c", "echo Hello, $NAME!"]

Commands

docker build -t sayhello .

docker run --rm sayhello
# Output: Hello, Captain!

docker run --rm -e NAME="Flora" sayhello
# Output: Hello, Flora!

Resources