- 현재버전 확인
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f2a6ee7384cf nginx:1.19.5-alpine "/docker-entrypoint.…" 5 weeks ago Up 6 seconds 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp nginx
9bc15edef76f ghost:3.35.4 "docker-entrypoint.s…" 5 weeks ago Up About a minute 2368/tcp ghost
582a783bd357 certbot/certbot "/bin/sh -c 'trap ex…" 6 weeks ago Up 6 weeks 80/tcp, 443/tcp nginx-certbot_certbot_1
$ docker images
REPOSITORY TAG IMAGE ID CREATED
ghost 3.35.4 93564ace4d2e 8 weeks ago 439MB
ghost 3.20 913adb142818 5 months ago 425MB
nginx 1.19.5-alpine 98ab35023fd6 10 days ago 22.3MB
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.38.2
3.38.2-alpine
3.38.3
3.38.3-alpine
3.39
3.39-alpine
3.39.0
3.39.0-alpine
3.4
...
3. 업그레이드 3.35.4 -> 3.39.0 (설치전 데이터 백업 필수)
ubuntu@hibuz:~/nginx-certbot$ vi docker-compose.yml
version: '3'
services:
ghost:
image: ghost:3.39.0
ubuntu@hibuz:~/nginx-certbot$ docker-compose up -d
Pulling ghost (ghost:3.39.0)...
3.39.0: Pulling from library/ghost
852e50cd189d: Pull complete
4feb33c38b25: Pull complete
6aacc458d694: Pull complete
2055b416f95b: Pull complete
45b5e630f43d: Pull complete
743faf096746: Pull complete
2cfbf9d19a24: Pull complete
cb2789257463: Pull complete
c4a4f55ad9a2: Pull complete
Digest: sha256:ac3733fcec41534f9dd24a787625017954ff6c0c80a940623611dded80f5a40f
Status: Downloaded newer image for ghost:3.39.0
Recreating ghost ...
Recreating ghost ... done
nginx is up-to-date
4. 업그레이드 확인
$ docker images
certbot/certbot latest 8354cb53c8c0 39 hours ago 96.5MB
ghost 3.39.0 9ebb9391dc1b 2 days ago 443MB
nginx 1.19.5-alpine 98ab35023fd6 10 days ago 22.3MB
ghost 3.35.4 93564ace4d2e 8 weeks ago 439MB
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5af945dc48e4 certbot/certbot "/bin/sh -c 'trap ex…" 9 seconds ago Up 7 seconds 80/tcp, 443/tcp nginx-certbot_certbot_1
f2a6ee7384cf nginx:1.19.5-alpine "/docker-entrypoint.…" 3 minutes ago Up 6 seconds 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp nginx
86d9eb05e8c5 ghost:3.39.0 "docker-entrypoint.s…" 3 minutes ago Up 8 seconds 2368/tcp ghost