Join our Discord Server
What is a Dockerfile?

Lab 4: Create a Docker image with CMD instruction

Estimated reading: 1 minute 38 views

Pre-requisite:

Tested Infrastructure

Platform Number of Instance Reading Time
Play with Docker 1 5 min

Pre-requisite

  • Create an account with DockerHub
  • Open PWD Platform on your browser
  • Click on Add New Instance on the left side of the screen to bring up Alpine OS instance on the right side

Creating Dockerfile

FROM alpine:3.6

RUN apk update
CMD ["top"]

Building Docker Container

docker build -t ajeetraina/lab3_cmd . -f Dockerfile_cmd

Running the Docker container

docker run ajeetraina/lab3_cmd:latest
Share this Doc

Lab 4: Create a Docker image with CMD instruction

Or copy link

CONTENTS
Join our Discord Server