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.7           "docker-entrypoint.s…"   6 weeks ago         Up 6 weeks          2368/tcp                                   ghost

$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nginx               1.18-alpine         ab94f84cc474        7 weeks ago         21.3MB
ghost               3.7                 e78340d8fd63        2 months ago        392MB
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.35.2-alpine
3.35.3
3.35.3-alpine
3.35.4
3.35.4-alpine
3.4
...

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

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

services:
  ghost:
    image: ghost:3.35.4


ubuntu@hibuz:~/nginx-certbot$ docker-compose up -d
Pulling ghost (ghost:3.35.4)...
3.35.4: Pulling from library/ghost
d121f8d1c412: Pull complete
3a54a24e4e59: Pull complete
647d090000ba: Pull complete
a13b38f68358: Pull complete
a815a43555c3: Pull complete
ddf7cd3d9778: Pull complete
fe06e5a59508: Pull complete
45a6984e3e84: Pull complete
5e7da404d82f: Pull complete
Digest: sha256:7a0ac09d5df2ff152e8828ca1c1a4100049868dcd898f2d056f8beca514a98a7
Status: Downloaded newer image for ghost:3.35.4
Recreating ghost ...
Recreating ghost ... done
nginx is up-to-date

4. 업그레이드 확인

$ docker images
ghost               3.35.4              93564ace4d2e        2 days ago          439MB
ghost               3.20                913adb142818        3 months ago        425MB
nginx               1.18-alpine         ab94f84cc474        5 months ago        21.3MB
ghost               3.7                 e78340d8fd63        7 months ago        392MB
certbot/certbot     latest              ce913a50e000        9 months ago        164MB

$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS                                      NAMES
d08fd3bf72ed        ghost:3.35.4        "docker-entrypoint.s…"   About a minute ago   Up About a minute   2368/tcp                                   ghost
06b4386aafc5        nginx:1.18-alpine   "/bin/sh -c 'while :…"   3 months ago         Up 23 minutes       0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   nginx
25dcfbe96c7f        certbot/certbot     "/bin/sh -c 'trap ex…"   3 months ago         Up About an hour    80/tcp, 443/tcp                            nginx-certbot_certbot_1