diff --git a/cmd/security-bootstrapper/Dockerfile b/cmd/security-bootstrapper/Dockerfile index d8645f8413..23a5a47434 100644 --- a/cmd/security-bootstrapper/Dockerfile +++ b/cmd/security-bootstrapper/Dockerfile @@ -35,22 +35,21 @@ RUN make cmd/security-bootstrapper/security-bootstrapper FROM alpine:3.14 LABEL license='SPDX-License-Identifier: Apache-2.0' \ - copyright='Copyright (c) 2022 Intel Corporation' + copyright='Copyright (c) 2021 Intel Corporation' RUN apk add --update --no-cache dumb-init su-exec -ENV SECURITY_INIT_STAGING_DIR /edgex-init-staging -ARG BOOTSTRAP_REDIS_DIR=${SECURITY_INIT_STAGING_DIR}/bootstrap-redis +ENV SECURITY_INIT_DIR /edgex-init +ARG BOOTSTRAP_REDIS_DIR=${SECURITY_INIT_DIR}/bootstrap-redis -RUN mkdir -p ${SECURITY_INIT_STAGING_DIR} \ - && mkdir -p /edgex-init \ +RUN mkdir -p ${SECURITY_INIT_DIR} \ && mkdir -p ${BOOTSTRAP_REDIS_DIR} -WORKDIR ${SECURITY_INIT_STAGING_DIR} +WORKDIR ${SECURITY_INIT_DIR} # copy all entrypoint scripts into shared folder -COPY --from=builder /edgex-go/cmd/security-bootstrapper/entrypoint-scripts/ ${SECURITY_INIT_STAGING_DIR}/ -RUN chmod +x ${SECURITY_INIT_STAGING_DIR}/*.sh +COPY --from=builder /edgex-go/cmd/security-bootstrapper/entrypoint-scripts/ ${SECURITY_INIT_DIR}/ +RUN chmod +x ${SECURITY_INIT_DIR}/*.sh COPY --from=builder /edgex-go/Attribution.txt / COPY --from=builder /edgex-go/cmd/security-bootstrapper/security-bootstrapper . @@ -60,10 +59,10 @@ COPY --from=builder /edgex-go/cmd/security-bootstrapper/res/configuration.toml . COPY --from=builder /edgex-go/cmd/security-bootstrapper/res-bootstrap-redis/configuration.toml ${BOOTSTRAP_REDIS_DIR}/res/ # copy Consul ACL related configs -COPY --from=builder /edgex-go/cmd/security-bootstrapper/consul-acl/ ${SECURITY_INIT_STAGING_DIR}/consul-bootstrapper/ +COPY --from=builder /edgex-go/cmd/security-bootstrapper/consul-acl/ ${SECURITY_INIT_DIR}/consul-bootstrapper/ # Expose the file directory as a volume since there's long-running state -VOLUME ${SECURITY_INIT_STAGING_DIR} +VOLUME ${SECURITY_INIT_DIR} # setup entry point script COPY --from=builder /edgex-go/cmd/security-bootstrapper/entrypoint.sh / diff --git a/cmd/security-bootstrapper/entrypoint.sh b/cmd/security-bootstrapper/entrypoint.sh index 23be80bd1d..5f71c40016 100755 --- a/cmd/security-bootstrapper/entrypoint.sh +++ b/cmd/security-bootstrapper/entrypoint.sh @@ -37,7 +37,6 @@ EDGEX_USER_ID=${EDGEX_USER:-$DEFAULT_EDGEX_USER_ID} # which then injecting into all other related containers on other services' entrypoint scripts # if the executable is not 'security-bootstrapper'; then we consider it not running the bootstrapping process # for the user may just want to debug into the container shell itself -cp -rpd /edgex-init-staging/* /edgex-init/ if [ "$1" = 'security-bootstrapper' ]; then # run the executable as ${EDGEX_USER} echo "$(date) Executing ./$@" @@ -48,3 +47,4 @@ else echo "current directory:" "$PWD" exec su-exec ${EDGEX_USER_ID} "$@" fi +cp -rpd /edgex-init/* /edgex-init-staging/ \ No newline at end of file