Fix docker build?

This commit is contained in:
Neale Pickett 2020-09-12 03:24:24 +00:00
parent 462cacad5a
commit e820812278
4 changed files with 16 additions and 25 deletions

View File

@ -1,12 +0,0 @@
name: moth-devel Docker build
on: [push]
jobs:
build-devel:
name: Build moth-devel
runs-on: ubuntu-latest
steps:
- name: Retrieve code
uses: actions/checkout@v1
- name: Build mothd
run: docker build -f Dockerfile.moth-devel .

View File

@ -9,4 +9,4 @@ jobs:
- name: Retrieve code - name: Retrieve code
uses: actions/checkout@v1 uses: actions/checkout@v1
- name: Build mothd - name: Build mothd
run: docker build -f Dockerfile.moth . run: docker build .

15
Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM golang:1.13 AS builder
COPY go.* /src/
COPY pkg /src/pkg/
COPY cmd /src/cmd/
WORKDIR /src/
#RUN go test ./...
RUN CGO_ENABLED=0 GOOS=linux go install -i -a -ldflags '-extldflags "-static"' ./...
FROM scratch
COPY --from=builder /go/bin/* /usr/bin/
COPY theme /theme/
COPY example-puzzles /puzzles/
COPY LICENSE.md /LICENSE.md
ENTRYPOINT [ "/usr/bin/mothd" ]

View File

@ -1,12 +0,0 @@
FROM golang:1.12.0-alpine AS builder
COPY src /go/src/github.com/dirtbags/moth/src
WORKDIR /go/src/github.com/dirtbags/moth/src
RUN go get .
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o /mothd *.go
FROM scratch
COPY --from=builder /mothd /mothd
COPY theme /theme
COPY LICENSE.md /LICENSE
ENTRYPOINT [ "/mothd" ]