Skip to content

Commit

Permalink
Dedicated user in Docker image.
Browse files Browse the repository at this point in the history
  • Loading branch information
Otávio Fernandes committed Mar 31, 2019
1 parent f196ab5 commit 69516f2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@ ENV GO_DOMAIN="github.com" \
GO_PROJECT="vault-handler"

ENV APP_DIR="${GOPATH}/src/${GO_DOMAIN}/${GO_GROUP}/${GO_PROJECT}" \
VAULT_HANDLER_OUTPUT_DIR="/vault/secrets"
USER_UID="1111" \
VAULT_HANDLER_OUTPUT_DIR="/var/lib/vault-handler"

RUN apk --update add bash
COPY --from=builder ${APP_DIR}/build/${GO_PROJECT} /usr/local/bin/${GO_PROJECT}

RUN mkdir -v -p ${VAULT_HANDLER_OUTPUT_DIR}
WORKDIR ${VAULT_HANDLER_OUTPUT_DIR}
RUN adduser -h ${VAULT_HANDLER_OUTPUT_DIR} -D -u ${USER_UID} ${GO_PROJECT}
USER ${USER_UID}

VOLUME ${VAULT_HANDLER_OUTPUT_DIR}
WORKDIR ${VAULT_HANDLER_OUTPUT_DIR}

ENTRYPOINT [ "/usr/local/bin/vault-handler" ]

0 comments on commit 69516f2

Please sign in to comment.