Skip to content

NOTE20201224

Somkiat Puisungnoen edited this page Dec 25, 2020 · 2 revisions

Note from course 2020/12/24-25 at IMC

1. Build docker image from Dockerfile

Example with Nginx

Dockerfile

FROM nginx:1.19.6
COPY index.html /usr/share/nginx/html/index.html 
RUN chown nginx:nginx /usr/share/nginx/html/*. # Change permission

Build process

$docker image build -t demo:1.0 .
$docker image ls

Create container from image

$docker container run -d -p 8888:80 demo:1.0
$docker container ls

2. Create first Docker-compose file

version: "3.9"
services:
  web:
    image: somkiat/hello
  proxy:
    image: somkiat/reverse-proxy
    ports:
      - 8080:8080 
Clone this wiki locally