1. 현재버전 확인
$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                                      NAMES
4b90b458fb5e   certbot/certbot         "/bin/sh -c 'trap ex…"   2 months ago   Up 6 days   80/tcp, 443/tcp                            nginx-certbot_certbot_1
f2a6ee7384cf   nginx:1.19.5-alpine     "/docker-entrypoint.…"   3 months ago   Up 6 days   0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   nginx
86d9eb05e8c5   ghost:3.39.0            "docker-entrypoint.s…"   3 months ago   Up 6 days   2368/tcp                                   ghost

$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED     
ghost                   3.39.0          9ebb9391dc1b   3 months ago    443MB
nginx                   1.19.5-alpine   98ab35023fd6   3 months ago    22.3MB
ghost                   3.35.4          93564ace4d2e   5 months ago    439MB

2. 신규 버전 확인

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

...
3.42.3
3.42.3-alpine
4.1
4.1-alpine
4.1.0
4.1.0-alpine
...

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

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

services:
  ghost:
    image: ghost:4.1.0


ubuntu@hibuz:~/nginx-certbot$ docker-compose up -d
Pulling ghost (ghost:4.1.0)...
4.1.0: Pulling from library/ghost
6f28985ad184: Extracting [============================>                      ]  15.63MB/27.1MB
45d607bea48c: Download complete
41fb1554a069: Download complete
b0c9c4030d8b: Download complete
5e269c64de4a: Download complete
2830ddc26eaa: Downloading [==>                                                ]  78.22kB/1.418MB
9c44da4a88ae: Waiting
94abe8efefc5: Waiting
8be51a9fe129: Waiting
Digest: sha256:ce0de99de93e5274923517b385c73ac1c8d762d6b46a38174e5755f249491641
Status: Downloaded newer image for ghost:4.1.0
Recreating ghost ...
Recreating ghost ... done
nginx is up-to-date

4. 업그레이드 확인

$ docker images
REPOSITORY              TAG             IMAGE ID       CREATED         SIZE
ghost                   4.1.0           c03c7fc2964e   2 days ago      440MB
certbot/certbot         latest          8354cb53c8c0   3 months ago    96.5MB
ghost                   3.39.0          9ebb9391dc1b   3 months ago    443MB
nginx                   1.19.5-alpine   98ab35023fd6   3 months ago    22.3MB

$ docker ps
CONTAINER ID   IMAGE                   COMMAND                  CREATED        STATUS       PORTS                                      NAMES
95e9e850d299   ghost:4.1.0             "docker-entrypoint.s…"   2 hours ago    Up 2 hours   2368/tcp                                   ghost
4b90b458fb5e   certbot/certbot         "/bin/sh -c 'trap ex…"   2 months ago   Up 6 days    80/tcp, 443/tcp                            nginx-certbot_certbot_1
f2a6ee7384cf   nginx:1.19.5-alpine     "/docker-entrypoint.…"   3 months ago   Up 6 days    0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   nginx