/docker101

A quick tutorial about docker

Primary LanguageDockerfile

Docker 101

Docker theory

Docker practice

Install docker on your machine

Use my repository: [https://github.com/g-dury/docker101] (https://github.com/g-dury/docker101)

Latest Docker version: 18.09.2

  1. Build a docker image helloworld

    • FROM (choose from docker hub)
    • ADD
    • RUN
    • and then CMD/ENTRYPOINT
    • go into the helloworld folder
    • docker build -t helloworld:1 .
  2. Launch a hello world service with docker

    • Know your docker commands:
      • docker ps -a
      • docker pull
      • docker run -d --name=hello helloworld:1
      • docker logs -f <CONTAINER>
      • docker stop
      • docker rm -f <CONTAINER>
  3. How to expose a container to the host

    • Use the -p argument
    • Understand the network notions of docker:
      • bridge
      • host
      • others
  4. Make two containers communicate with each other

  5. Make data of docker container persistent: volumes