1. 현재버전 확인
$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                                      NAMES
6833f559d95f        nginx:1.17-alpine   "/bin/sh -c 'while :…"   6 weeks ago         Up 13 days          0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   nginx
582a783bd357        certbot/certbot     "/bin/sh -c 'trap ex…"   6 weeks ago         Up 6 weeks          80/tcp, 443/tcp                            nginx-certbot_certbot_1
d7f23a5d5b7d        ghost:3.8           "docker-entrypoint.s…"   6 weeks ago         Up 6 weeks          2368/tcp                                   ghost

$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
ghost               3.8                 a6ab8e0a010a        2 months ago        394MB
ghost               3.7                 e78340d8fd63        2 months ago        392MB
nginx               1.17-alpine         48c8a7c47625        3 months ago        21.8MB
certbot/certbot     latest              ce913a50e000        3 months ago        164MB

2. 신규 버전 확인

$ curl -s https://registry.hub.docker.com/v1/repositories/ghost/tags | sed "s/,/\n/g" | grep name | cut -d '"' -f 4
3.8
3.8-alpine
3.8.0
3.8.0-alpine
3.9
3.9-alpine
3.9.0
3.9.0-alpine

3. 업그레이드 3.8 -> 3.9 (설치전 데이터 백업 필수)

ubuntu@hibuz:~/nginx-certbot$ vi docker-compose.yml
version: '3'

services:
  ghost:
    image: ghost:3.9


ubuntu@hibuz:~/nginx-certbot$ docker-compose up -d
Pulling ghost (ghost:3.9)...
3.9: Pulling from library/ghost
68ced04f60ab: Already exists
d08ae0b74f9b: Already exists
fae40cf84f67: Already exists
b2e030243655: Already exists
2f877e419203: Already exists
21f095ca0a43: Already exists
8b6adca4bd4f: Already exists
144907c3f39f: Extracting [==========================================>        ]  50.69MB/60.26MB
3fef405474e9: Download complete
Digest: sha256:4a08798b214248c19fa07588bd5ac1918a05a0fe341574908d4030ec6ebcae45
Status: Downloaded newer image for ghost:3.9
nginx-certbot_certbot_1 is up-to-date
Recreating ghost ... done
nginx is up-to-date

4. 업그레이드 확인

$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
ghost               3.9                 d8ae52f032ab        8 weeks ago         392MB
ghost               3.8                 a6ab8e0a010a        2 months ago        394MB
ghost               3.7                 e78340d8fd63        2 months ago        392MB

$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS                                      NAMES
2a5027fdbba9        ghost:3.9           "docker-entrypoint.s…"   About a minute ago   Up About a minute   2368/tcp                                   ghost