반응형
도커에 이미지에 이름과 테그 넣기
도커이미지를 그냥 만들면 이름과 테그가 <none>으로 나온다 그렇게 된다면 구분을 하기 힘드므로 이름과 테그를 넣을수 있다.
$ docker build .
방법
$ docker tag <IMAGE ID> <REPOSITORY_NAME>:<TAG_NAMD>
## ex
$ docker tag b214dff871f3 node-test-docker:v1
## 기존
(base) ➜ test_dokcer git:(main) ✗ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> b214dff871f3 About a minute ago 921MB
my_pacman 1.0 dc172718e86f 2 months ago 144MB
httpd latest a8ea074f4566 3 months ago 144MB
sebcontents/server latest 6d83150df9dd 3 months ago 178MB
sebcontents/client latest 52bfef33cd3d 3 months ago 142MB
sebcontents/part1 latest aa619f16919f 10 months ago 138MB
danielkraic/asciiquarium latest 7bab964067d2 3 years ago 309MB
docker/whalesay latest 6b362a9f73eb 6 years ago 247MB
(base) ➜ test_dokcer git:(main) ✗ docker tag b214dff871f3 node-test-docker:v1
## 바뀐후
(base) ➜ test_dokcer git:(main) ✗ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
node-test-docker v1 b214dff871f3 4 minutes ago 921MB
my_pacman 1.0 dc172718e86f 2 months ago 144MB
httpd latest a8ea074f4566 3 months ago 144MB
sebcontents/server latest 6d83150df9dd 3 months ago 178MB
sebcontents/client latest 52bfef33cd3d 3 months ago 142MB
sebcontents/part1 latest aa619f16919f 10 months ago 138MB
danielkraic/asciiquarium latest 7bab964067d2 3 years ago 309MB
docker/whalesay latest 6b362a9f73eb 6 years ago 247MB
잘들어간 모습을 볼 수 있다.
reference
https://webdock.io/en/docs/how-guides/docker-guides/how-create-custom-docker-images
How to create custom docker images
This guide describes the basic steps to create a custom docker image.
webdock.io
https://nodejs.org/ko/docs/guides/nodejs-docker-webapp/
Node.js 웹 앱의 도커라이징 | Node.js
Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.
nodejs.org