도커 이미지의 태그 변경하기
# docker tag 이미지명:[기존태그이름] 변경이미지명:[변경태그이름]
➜ ~ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
bongoo 1.0.0 90d1f81f0c97 14 hours ago 267MB
<none> <none> c94415d27e2f 8 weeks ago 267MB
<none> <none> 63a51fc658ac 3 months ago 1.02GB
node 20.12.2-alpine3.19 3b62bffc0937 5 months ago 133MB
➜ ~ docker tag boogoo:1.0.0 bong9kim:1.0.0
➜ ~ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
bong9kim 1.0.0 90d1f81f0c97 14 hours ago 267MB
bongoo 1.0.0 90d1f81f0c97 14 hours ago 267MB
<none> <none> c94415d27e2f 8 weeks ago 267MB
<none> <none> 63a51fc658ac 3 months ago 1.02GB
node 20.12.2-alpine3.19 3b62bffc0937 5 months ago 133MB
https://hub.docker.com 에 temoojean repository 에 bong9kim 이라는 이미지 저장소를 만들었다고 가정한다.
도커 로그인 되어 있다는 가정하에
위의 이미지를 푸시 하면
➜ ~ docker push bong9kim:1.0.0
The push refers to repository [docker.io/library/bong9kim]
13fdf3b6e95a: Preparing
0e291deb2356: Preparing
c09f41d82da8: Preparing
1a976c1aad66: Preparing
163d5965adaa: Preparing
192f30c871e1: Waiting
84c6eaf0eec7: Waiting
3f47b066c0b9: Waiting
42d523a91915: Waiting
b09314aec293: Waiting
denied: requested access to the resource is denied
안된다.
image 의 respository 를 잘못 변경 하였다
➜ ~ docker tag bong9kim:1.0.0 temoojean/bong9kim:1.0.0
➜ ~ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
bong9kim 1.0.0 90d1f81f0c97 14 hours ago 267MB
bongoo 1.0.0 90d1f81f0c97 14 hours ago 267MB
temoojean/bong9kim 1.0.0 90d1f81f0c97 14 hours ago 267MB
<none> <none> c94415d27e2f 8 weeks ago 267MB
<none> <none> 63a51fc658ac 3 months ago 1.02GB
node 20.12.2-alpine3.19 3b62bffc0937 5 months ago 133MB
repository 명을 hub.docker.com 과 동일하게 맞춘걸 푸시 해주자.
➜ ~ docker push temoojean/bong9kim:1.0.0
The push refers to repository [docker.io/temoojean/bong9kim]
13fdf3b6e95a: Pushed
0e291deb2356: Pushed
c09f41d82da8: Pushed
1a976c1aad66: Pushed
163d5965adaa: Pushed
192f30c871e1: Pushed
84c6eaf0eec7: Pushed
3f47b066c0b9: Pushed
42d523a91915: Pushed
b09314aec293: Pushed
1.0.0: digest: sha256:f98e1006d114bf38299c259aa9c8249bfdbeae045bdad2c286f5f2e9934a0b52 size: 2411
잘 올라가 있다.
'코드 > CI-CD-Docker' 카테고리의 다른 글
[Docker] Image pull (0) | 2024.09.13 |
---|---|
[CI/CD] anchor 를 사용하여 YAML template 만들기 (0) | 2024.07.31 |
[CI/CD] YAML Anchor (0) | 2024.07.30 |
[CI/CD] YAML 기본 (0) | 2024.07.30 |
[CI/CD] Gitlab stop action (0) | 2024.07.29 |