fix cobra to sentry + change ws docker file to use alpine (much smaller footprint)

This commit is contained in:
Benjamin Sergeant
2019-05-31 00:43:22 -07:00
parent c65fec7271
commit 285386e47f
7 changed files with 61 additions and 10 deletions

33
docker/Dockerfile.alpine Normal file
View File

@ -0,0 +1,33 @@
FROM alpine as build
RUN apk add --no-cache gcc g++ musl-dev linux-headers cmake openssl-dev
RUN apk add --no-cache make
RUN apk add --no-cache zlib-dev
RUN addgroup -S app && adduser -S -G app app
RUN chown -R app:app /opt
RUN chown -R app:app /usr/local
# There is a bug in CMake where we cannot build from the root top folder
# So we build from /opt
COPY --chown=app:app . /opt
WORKDIR /opt
USER app
RUN [ "make" ]
FROM alpine as runtime
RUN apk add --no-cache libstdc++
RUN addgroup -S app && adduser -S -G app app
COPY --chown=app:app --from=build /usr/local/bin/ws /usr/local/bin/ws
RUN chmod +x /usr/local/bin/ws
RUN ldd /usr/local/bin/ws
# Now run in usermode
USER app
WORKDIR /home/app
ENTRYPOINT ["ws"]
CMD ["--help"]