Browse Source

Update Docker build.

change-name
Robert Jacob 2 years ago
parent
commit
5ca165b3ee
2 changed files with 5 additions and 3 deletions
  1. +4
    -2
      Dockerfile
  2. +1
    -1
      build-image.sh

+ 4
- 2
Dockerfile View File

@ -2,13 +2,15 @@ FROM golang:1 AS builder
ENV CGO_ENABLED=0
WORKDIR /go/src/git.hacknology.de/projekte/spaceapi
WORKDIR /build
COPY . .
RUN go test ./...
RUN go install -v -tags netgo -ldflags "-w" ./cmd/spaceapi-server
FROM busybox
LABEL maintainer="Xperimental"
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /go/bin/spaceapi-server /bin/spaceapi-server
RUN mkdir /data
@ -16,4 +18,4 @@ RUN mkdir /data
EXPOSE 8080
WORKDIR /data
VOLUME [ "/data" ]
ENTRYPOINT [ "/bin/spaceapi-server" ]
ENTRYPOINT [ "/bin/spaceapi-server" ]

+ 1
- 1
build-image.sh View File

@ -7,4 +7,4 @@ TAG=$(git rev-parse --short HEAD)
readonly TAG
readonly IMAGE="${REPO}:${TAG}"
docker build -t "${IMAGE}" .
docker build --pull -t "${IMAGE}" .

Loading…
Cancel
Save