should work this time fr fr
This commit is contained in:
parent
67c4773f2b
commit
44968a38bc
2 changed files with 15 additions and 3 deletions
11
Taskfile.yml
11
Taskfile.yml
|
@ -18,13 +18,14 @@ tasks:
|
|||
- "go build -o out/{{OS}}/ ."
|
||||
preconditions:
|
||||
- sh: "which go"
|
||||
msg: Go is not installed. Install Go or build with Docker using the "docker" task
|
||||
|
||||
build:docker:
|
||||
aliases:
|
||||
- docker
|
||||
cmds:
|
||||
- task: build:docker:dockercli
|
||||
- "docker build -t listen-build -f docker/build.Dockerfile --build-arg GOOS='{{OS}}' ."
|
||||
- "docker build -t listen-build -f docker/build.Dockerfile --build-arg GOOS='{{OS}}' --build-arg GOARCH='{{ARCH}}' ."
|
||||
- "mkdir -p out/{{OS}}"
|
||||
- "docker create --name listen-build-tmp listen-build"
|
||||
- cmd: "docker cp listen-build-tmp:{{.DOCKER_EXE}}.exe out/{{OS}}/"
|
||||
|
@ -46,3 +47,11 @@ tasks:
|
|||
- cmd: '"C:\Program Files\Docker\Docker\DockerCli.exe" -SwitchLinuxEngine'
|
||||
platforms:
|
||||
- windows
|
||||
|
||||
clean:
|
||||
cmds:
|
||||
- rm -rf out/
|
||||
- cmd: docker image rm listen-build
|
||||
ignore_error: true
|
||||
- cmd: docker rm listen-build-tmp
|
||||
ignore_error: true
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
# listen is currently not intended to run in a Docker container
|
||||
|
||||
ARG IMAGE="1-alpine"
|
||||
ARG GOOS="linux"
|
||||
|
||||
FROM golang:${IMAGE} AS build
|
||||
|
||||
|
@ -10,6 +9,10 @@ WORKDIR /usr/src/listen
|
|||
COPY . .
|
||||
|
||||
RUN apk upgrade --no-cache
|
||||
RUN go build -o out/$GOOS/ .
|
||||
ARG GOOS="linux"
|
||||
RUN go env -w GOOS=${GOOS}
|
||||
ARG GOARCH="amd64"
|
||||
RUN go env -w GOARCH=${GOARCH}
|
||||
RUN go build -o out/$(go env GOOS)/ .
|
||||
|
||||
CMD ["tail", "-f", "/dev/null"]
|
||||
|
|
Loading…
Add table
Reference in a new issue