windows working, reverting dockerfile to simple go build
This commit is contained in:
parent
3ea2c41dc6
commit
629ead13f2
2 changed files with 12 additions and 8 deletions
17
Taskfile.yml
17
Taskfile.yml
|
@ -18,15 +18,12 @@ 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:
|
||||
- cmd: "/c/Program\ Files/Docker/Docker/DockerCli.exe -SwitchLinuxEngine"
|
||||
platforms:
|
||||
- windows
|
||||
- task: build:docker:dockercli
|
||||
- "docker build -t listen-build -f docker/build.Dockerfile --build-arg GOOS='{{OS}}' ."
|
||||
- "mkdir -p out/{{OS}}"
|
||||
- "docker create --name listen-build-tmp listen-build"
|
||||
|
@ -39,5 +36,13 @@ tasks:
|
|||
- linux
|
||||
- "docker rm listen-build-tmp"
|
||||
preconditions:
|
||||
- "which docker"
|
||||
- "uname | grep -qe Linux -e MINGW"
|
||||
- sh: "uname | grep -qe Linux -e MINGW -e Darwin"
|
||||
msg: "This task cannot be ran on OS: {{OS}}"
|
||||
- sh: "which docker"
|
||||
msg: Docker is not installed. Install Docker or build with Go using the "build" task
|
||||
|
||||
build:docker:dockercli:
|
||||
cmds:
|
||||
- cmd: '"C:\Program Files\Docker\Docker\DockerCli.exe" -SwitchLinuxEngine'
|
||||
platforms:
|
||||
- windows
|
||||
|
|
|
@ -9,8 +9,7 @@ WORKDIR /usr/src/listen
|
|||
COPY . .
|
||||
|
||||
RUN apk upgrade --no-cache
|
||||
RUN go install github.com/go-task/task/v3/cmd/task@latest
|
||||
ENV GOOS="linux"
|
||||
RUN task build
|
||||
RUN go build -o out/$GOOS/ .
|
||||
|
||||
CMD ["tail", "-f", "/dev/null"]
|
||||
|
|
Loading…
Add table
Reference in a new issue