Simplified the docker image (#80)
This commit is contained in:
parent
7acf318b28
commit
6746984c97
4 changed files with 16 additions and 30 deletions
40
Dockerfile
40
Dockerfile
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
###################################
|
##############
|
||||||
#Build stage
|
# Build stage
|
||||||
FROM golang:1.11-alpine AS build-env
|
FROM golang:1.11-alpine AS build-env
|
||||||
|
|
||||||
ARG VIKUNJA_VERSION
|
ARG VIKUNJA_VERSION
|
||||||
|
@ -8,10 +8,10 @@ ENV TAGS "sqlite"
|
||||||
ENV GO111MODULE=on
|
ENV GO111MODULE=on
|
||||||
ENV GOFLAGS=-mod=vendor
|
ENV GOFLAGS=-mod=vendor
|
||||||
|
|
||||||
#Build deps
|
# Build deps
|
||||||
RUN apk --no-cache add build-base git
|
RUN apk --no-cache add build-base git
|
||||||
|
|
||||||
#Setup repo
|
# Setup repo
|
||||||
COPY . ${GOPATH}/src/code.vikunja.io/api
|
COPY . ${GOPATH}/src/code.vikunja.io/api
|
||||||
WORKDIR ${GOPATH}/src/code.vikunja.io/api
|
WORKDIR ${GOPATH}/src/code.vikunja.io/api
|
||||||
|
|
||||||
|
@ -19,27 +19,19 @@ WORKDIR ${GOPATH}/src/code.vikunja.io/api
|
||||||
RUN if [ -n "${VIKUNJA_VERSION}" ]; then git checkout "${VIKUNJA_VERSION}"; fi \
|
RUN if [ -n "${VIKUNJA_VERSION}" ]; then git checkout "${VIKUNJA_VERSION}"; fi \
|
||||||
&& make clean build
|
&& make clean build
|
||||||
|
|
||||||
FROM alpine:3.7
|
###################
|
||||||
|
# The actual image
|
||||||
|
# Note: I wanted to use the scratch image here, but unfortunatly the go-sqlite bindings require cgo and
|
||||||
|
# for whatever reason, the container would not start when I compiled the image without cgo.
|
||||||
|
FROM alpine:3.9
|
||||||
LABEL maintainer="maintainers@vikunja.io"
|
LABEL maintainer="maintainers@vikunja.io"
|
||||||
|
|
||||||
EXPOSE 3456
|
WORKDIR /app/vikunja/
|
||||||
|
COPY --from=build-env /go/src/code.vikunja.io/api/templates ./templates
|
||||||
RUN apk --no-cache add \
|
COPY --from=build-env /go/src/code.vikunja.io/api/vikunja .
|
||||||
bash \
|
RUN chown nobody:nogroup -R /app/vikunja
|
||||||
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
|
|
||||||
|
|
||||||
ENV VIKUNJA_SERVICE_ROOTPATH=/app/vikunja/
|
ENV VIKUNJA_SERVICE_ROOTPATH=/app/vikunja/
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/s6-svscan", "/etc/services.d"]
|
USER nobody:nogroup
|
||||||
CMD []
|
CMD ["/app/vikunja/vikunja"]
|
||||||
|
EXPOSE 3456
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
/bin/true
|
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
/bin/true
|
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/execlineb -P
|
|
||||||
/app/vikunja/vikunja
|
|
Loading…
Reference in a new issue