-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from NBISweden/feature/docker
Add docker stuff
- Loading branch information
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.github/ | ||
data/ | ||
datasecond/ | ||
docker-compose.yml | ||
READNE.md | ||
main | ||
config.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM golang:1.15.5-alpine3.12 | ||
RUN apk add --no-cache git | ||
COPY . . | ||
ENV GO111MODULE=on | ||
ENV GOPATH=$PWD | ||
ENV CGO_ENABLED=0 | ||
ENV GOOS=linux | ||
RUN go build -ldflags "-extldflags -static" -o ./build/svc . | ||
RUN echo "nobody:x:65534:65534:nobody:/:/sbin/nologin" > passwd | ||
|
||
FROM scratch | ||
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=0 /go/build/svc svc | ||
COPY --from=0 /go/passwd /etc/passwd | ||
USER 65534 | ||
EXPOSE 8080 | ||
ENTRYPOINT [ "/svc" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash -xe | ||
docker build \ | ||
--build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ | ||
--build-arg "SOURCE_COMMIT=${SOURCE_COMMIT}" \ | ||
-t ${IMAGE_NAME} . |