how to create docker image code example
Example 1: how to build docker image
docker build <Dockerfile path> -t image-name
Example 2: docker create
docker create [options] IMAGE
-a, --attach
-i, --interactive
-t, --tty
--name NAME
-p, --publish 5000:5000
--expose 5432
-P, --publish-all
--link container:alias
-v, --volume `pwd`:/app
-e, --env NAME=hello
Example 3: docker images command
docker images
NOTE:
To see which images are present locally, use the "docker images" command:
REPOSITORY TAG IMAGE ID CREATED SIZE
debian jessie f50f9524513f 5 days ago 125.1 MB
debian latest f50f9524513f 5 days ago 125.1 MB
Example 4: create dockerfile
FROM ubuntu:18.04
COPY . /app
RUN make /app
CMD python /app/app.py