Docker image commands- Part-01

$ docker image build --help
FROM nginx:alpineCMD ["nginx", "-g", "daemon off;"]
  1. Create a docker image
$ docker image build -t myapp:v1.0.0 .
$ docker image build -t myapp:v1.0.0 -f Dockerfile/sample/prod.dockerfile .
$ docker build --cpu-shares=2 --memory=1024m -t myapp:1.0 .
$ docker build --pull --no-cache --tag myapp:v1 .
FROM alpine:3.9.3#Setting a default value to Argument WELCOME_USER
ARG WELCOME_USER=Bikram
RUN echo "Welcome $WELCOME_USER, to Docker World!" > message.txt
CMD cat message.txt
$ docker image build -t arg:v1 .
$ docker run arg:v1
$ docker image build -t arg:v2 --build-arg WELCOME_USER=Google .
$ docker run arg:v2
$ docker image history httpd -H

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store