@
img 3e690099-1045-4fa8-93bc-2209474d8401
Install git
docker run -it ubuntu:latest --name git /bin/bash
In ubuntu,
apt-get update &> /dev/null
apt-get install -y git &> /dev/null
git --version
For stability, open another terminal
docker ps
docker diff
docker commit ubuntu:git
@
dockerfile is dsl which is used for docker, written by process of generating image
cd docker_introduction
make dockerfile
touch dockerfile
With what image will you create docker image?
I will use ubuntu:16.04
FROM ubuntu:16.04
# Commands you will run on this image
RUN apt-get update
# You must use -y option
RUN apt-get install -y git
# And build it
# . means we create docker image by using image located in one step below directory
# -t ubuntu:git02 means docker image name
docker build -t ubuntu:git02 .
@
add file
You should be one step upper parent directory
Then, add file located in one step below directory
ADD data.txt /tmp/data.txt
@
https//github.com/nacyot/docker_tutorial
docker build -t /docker_tutorial
@
You can change name of docker image
docker tag nacyot/docker_tutorial:latest nacyot/docker_abc:latest
@
You can use hub.docker.com
Create repository which will contain images
docker login
docker images l grep nacyot/docker_tutorial
You can push image
docker push nacyot/docker_tutorial:latest
You can pull image
docker pull nacyot/docker_tutorial