Build And Run
Part of the Introduction to Docker section of Coddy's Terminal journey — lesson 35 of 40.
Challenge
MediumNow turn the Dockerfile into a real image and run it. Run these commands one after the other:
- Write the Dockerfile again:
FROM alpineandCMD ["echo", "Welcome to the greeting app"] - Build it tagged
greetapp - Run
greetappso itsCMDgreeting prints
Try it yourself
Terminal
cat > Dockerfile << 'EOF'
FROM alpine
CMD ["echo", "Welcome to the greeting app"]
EOF
cat DockerfileAll lessons in Introduction to Docker
4Managing Containers
Naming ContainersDetached ContainersListing All ContainersStopping And RemovingRecap - Container Lifecycle10Greeting App Project
Project OverviewWrite The Dockerfile