瀏覽代碼

Update Docker build.

change-name
Robert Jacob 1 年之前
父節點
當前提交
5ca165b3ee
共有 2 個文件被更改,包括 5 次插入3 次删除
  1. +4
    -2
      Dockerfile
  2. +1
    -1
      build-image.sh

+ 4
- 2
Dockerfile 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存