Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #12 from microservices-demo/build/user
Browse files Browse the repository at this point in the history
Added user to dockerfile.
  • Loading branch information
Phil Winder authored Nov 8, 2016
2 parents d22c556 + be326bc commit 99ef5ee
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion docker/catalogue/Dockerfile-release
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
FROM busybox:1
FROM alpine:3.4

ENV SERVICE_USER=myuser \
SERVICE_UID=10001 \
SERVICE_GROUP=mygroup \
SERVICE_GID=10001

RUN addgroup -g ${SERVICE_GID} ${SERVICE_GROUP} && \
adduser -g "${SERVICE_NAME} user" -D -H -G ${SERVICE_GROUP} -s /sbin/nologin -u ${SERVICE_UID} ${SERVICE_USER} && \
apk add --update libcap

WORKDIR /
EXPOSE 80
COPY app /
COPY images/ /images/

RUN chmod +x /app && \
chown -R ${SERVICE_USER}:${SERVICE_GROUP} /app /images && \
setcap 'cap_net_bind_service=+ep' /app

USER ${SERVICE_USER}

ARG BUILD_DATE
ARG BUILD_VERSION
ARG COMMIT
Expand Down

0 comments on commit 99ef5ee

Please sign in to comment.