1. 현재버전 확인
$ docker ps
CONTAINER ID   IMAGE                   COMMAND                  CREATED          STATUS          PORTS                                      NAMES
f67902375e94   nginx:1.19.5-alpine     "/docker-entrypoint.…"   5 weeks ago     Up 2 minutes        0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   nginx
b813b1c51e04   ghost:4.1.0             "docker-entrypoint.s…"   5 weeks ago     Up 2 minutes        2368/tcp                                   ghost


$ docker images
REPOSITORY              TAG             IMAGE ID       CREATED         SIZE
ghost                   4.1.0           c03c7fc2964e   8 weeks ago     440MB
certbot/certbot         latest          8354cb53c8c0   5 months ago    96.5MB
ghost                   3.39.0          9ebb9391dc1b   5 months ago    443MB

2. 신규 버전 확인

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

...
4.4
4.4-alpine
4.4.0
4.4.0-alpine
4.5
4.5-alpine
4.5.0
4.5.0-alpine
alpine

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

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

services:
  ghost:
    image: ghost:4.5.0


ubuntu@hibuz:~/nginx-certbot$ docker-compose up -d
Pulling ghost (ghost:4.5.0)...
4.5.0: Pulling from library/ghost
69692152171a: Pull complete
15c9a4a75a9a: Pull complete
c548bd93bc33: Pull complete
a2fde13f6b72: Pull complete
aef01cdc4384: Pull complete
e7b67caf303f: Pull complete
201051a0bf39: Pull complete
ca422add453c: Pull complete
a91772022367: Pull complete
Digest: sha256:248b792b71e4b1de84aa675aabeeefad4c91612c7203365659caa9ea9094c402
Status: Downloaded newer image for ghost:4.5.0
Recreating ghost ...
Recreating ghost ... done
nginx is up-to-date

4. 업그레이드 확인

$ docker images
REPOSITORY              TAG             IMAGE ID       CREATED         SIZE
ghost                   4.5.0           c908524b5920   3 days ago      452MB
nginx                   1.20.0-alpine   3b715e351972   3 weeks ago     22.6MB
ghost                   4.1.0           c03c7fc2964e   8 weeks ago     440MB
certbot/certbot         latest          8354cb53c8c0   5 months ago    96.5MB

$ docker ps
CONTAINER ID   IMAGE                   COMMAND                  CREATED         STATUS          PORTS                                      NAMES
472e3746940a   nginx:1.20.0-alpine     "/docker-entrypoint.…"   2 minutes ago   Up 2 minutes    0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   nginx
abbafe515aa0   ghost:4.5.0             "docker-entrypoint.s…"   2 minutes ago   Up 2 minutes    2368/tcp                                   ghost
56fca6439c86   certbot/certbot         "/bin/sh -c 'trap ex…"   8 weeks ago     Up 2 minutes    80/tcp, 443/tcp                            nginx-certbot_certbot_1