diff --git a/Dockerfile b/Dockerfile index 107b096..5b5644d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,11 +22,14 @@ RUN apk --no-cache add tzdata RUN echo "Asia/Seoul" > /etc/timezone RUN cp -f /usr/share/zoneinfo/Asia/Seoul /etc/localtime -RUN apk --no-cache add ansible +RUN apk --no-cache add ansible curl COPY --from=builder /go/src/github.com/cloud-barista/cm-grasshopper/conf /conf COPY --from=builder /go/src/github.com/cloud-barista/cm-grasshopper/cmd/cm-grasshopper/cm-grasshopper /cm-grasshopper +RUN mkdir -p /root/.cm-grasshopper/ +RUN curl --ipv4 https://raw.githubusercontent.com/cloud-barista/cm-honeybee/main/server/_default_key/honeybee.key -o /root/.cm-grasshopper/honeybee.key + USER root CMD ["/cm-grasshopper"] diff --git a/Makefile b/Makefile index 4f2d34c..2c87ba1 100644 --- a/Makefile +++ b/Makefile @@ -125,9 +125,6 @@ run_docker: ## Run the built binary within Docker GIT_HASH_MINE=`git rev-parse HEAD` && \ GIT_HASH_LAST_BUILD=`cat .git_hash_last_build 2>&1 > /dev/null | true` && \ if [ "$$STATUS" != "0" ] || [ "$$GIT_HASH_MINE" != "$$GIT_HASH_LAST_BUILD" ]; then \ - if [ ! -f "./honeybee.key" ]; then \ - docker cp cm-honeybee:/root/.cm-honeybee/honeybee.key .; \ - fi && \ docker rmi -f cm-grasshopper:latest; \ fi @docker compose up -d diff --git a/README.md b/README.md index 65250be..e00fdbc 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,12 @@ Or, you can run it within Docker by this command. make run_docker ``` +Docker container will use the default honeybee private key file. +To use the copied honeybee private key file, uncomment it below in the `docker-compose.yaml` file. +```shell +#- ./honeybee.key:/root/.cm-grasshopper/honeybee.key:ro +``` + ### Health-check Check if CM-Grasshopper is running diff --git a/docker-compose.yaml b/docker-compose.yaml index 1ff89ae..f15f05a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -8,7 +8,7 @@ services: image: cm-grasshopper:${TAG:-latest} volumes: #- ./CM-GRASSHOPPER.db:/CM-GRASSHOPPER.db:rw - - ./honeybee.key:/root/.cm-grasshopper/honeybee.key:ro + #- ./honeybee.key:/root/.cm-grasshopper/honeybee.key:ro - ./software_temp:/software_temp:rw - ./software_log:/software_log:rw - ./playbook:/playbook/:rw