Docker Cheatsheet




Build

Building an image from Dockerfile

docker build -t app_name:1.0 .

List all images

docker images

Ship

Push docker image

docker push user_id/my_image

Run

Run docker image

docker run -p 8001:8001 -it  app_name:1.0

List all running containers

docker ps

Kill a running container

docker kill container_name/ container_id 

Dockerfile syntax

FROM ubuntu:16.04 # from base image
RUN apt-get update # execute commands
ADD local_directory /
EXPOSE 8080


┬ęCopyright 2019 OneCompiler | Privacy Policy | Terms & Conditions