Skip to content

dwi13L/the_dockerphile

Repository files navigation

Dockerphile

Writing the Dockerfile and building images using docker CLI

Build

docker build -t [name] [pathToDockerfile]

Run

#Syntax
docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

#Run named container
docker container run --name [container_name] [docker_image]

#Run container in the background
docker container run -d [docker_image]

#Run container interactively
docker container run -it [docker_image] /bin/bash

#Run container and publish container ports
-p [host_ip]:[host_port]:[container_port]

#Run a container and mount host volume
-v [/host/volume/location]:[/container/storage]

#Run container and remove once container is stopped
docker container run --rm [docker_image]

visit hello_moby_dock for more details

About

Getting started with the Dockerfile

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published