Use the scratch image as the base instead of the alpine one to remove unneeded bloat
continuous-integration/drone/push Build is passing Details

This commit is contained in:
kolaente 2019-06-02 14:27:25 +02:00
parent 7acf318b28
commit 608d076fcd
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
4 changed files with 12 additions and 27 deletions

View File

@ -1,6 +1,6 @@
###################################
#Build stage
##############
# Build stage
FROM golang:1.11-alpine AS build-env
ARG VIKUNJA_VERSION
@ -8,10 +8,10 @@ ENV TAGS "sqlite"
ENV GO111MODULE=on
ENV GOFLAGS=-mod=vendor
#Build deps
# Build deps
RUN apk --no-cache add build-base git
#Setup repo
# Setup repo
COPY . ${GOPATH}/src/code.vikunja.io/api
WORKDIR ${GOPATH}/src/code.vikunja.io/api
@ -19,27 +19,18 @@ WORKDIR ${GOPATH}/src/code.vikunja.io/api
RUN if [ -n "${VIKUNJA_VERSION}" ]; then git checkout "${VIKUNJA_VERSION}"; fi \
&& make clean build
FROM alpine:3.7
###################
# The actual image
FROM scratch
LABEL maintainer="maintainers@vikunja.io"
EXPOSE 3456
RUN apk --no-cache add \
bash \
ca-certificates \
curl \
gettext \
linux-pam \
s6 \
sqlite \
su-exec \
tzdata
COPY docker /
COPY --from=build-env /go/src/code.vikunja.io/api/templates /app/vikunja/templates
COPY --from=build-env /go/src/code.vikunja.io/api/vikunja /app/vikunja/vikunja
USER nobody:nogroup
WORKDIR /app/vikunja/
COPY --from=build-env /go/src/code.vikunja.io/api/templates ./templates
COPY --from=build-env /go/src/code.vikunja.io/api/vikunja .
ENV VIKUNJA_SERVICE_ROOTPATH=/app/vikunja/
ENTRYPOINT ["/bin/s6-svscan", "/etc/services.d"]
CMD []
CMD ["/app/vikunja/vikunja"]

View File

@ -1,2 +0,0 @@
#!/bin/sh
/bin/true

View File

@ -1,2 +0,0 @@
#!/bin/sh
/bin/true

View File

@ -1,2 +0,0 @@
#!/bin/execlineb -P
/app/vikunja/vikunja