DevOps./Docker

[Docker] Microservice 도커 이미지 생성하기

PI.314 2022. 1. 28. 20:26

Dockerfile 생성

$ docker build -t [유저아이디]/[도커이미지이름] .

$ docker push [유저아이디]/[도커이미지이름]

$ docker pull [유저아이디]/[도커이미지이름]

package compile
target 폴더 확인
docker build
docker image list
docker push & login
docker hub repository 생성완료
docker 이미지 삭제 & docker pull
docker run (microservice)

docker run -d --network ecommerce-network \
--name user-service \
-e "spring.cloud.config.uri=http://config-service:8888" \
-e "spring.rabbitmq.host=rabbitmq" \
-e "spring.zipkin.base-url=http://zipkin:9411" \
-e "eureka.client.serviceUrl.defaultZone=http://discovery-service:8761/eureka/" \
-e "logging.file=/api-logs/users-ws.log" \
gyeom/user-service:1.0