use golang builder
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/deployment/woodpecker Pipeline failed

update ci
This commit is contained in:
Simon Vieille 2023-06-06 22:07:35 +02:00
parent d1a1058f28
commit 97c5ce0b7b
Signed by: deblan
GPG key ID: 579388D585F70417
3 changed files with 24 additions and 5 deletions

4
.dockerignore Normal file
View file

@ -0,0 +1,4 @@
/capture
/.woodpecker.yml
/.git
/.gitignore

View file

@ -15,7 +15,7 @@ pipeline:
commands:
- go build -o /artifacts/capture
push-release:
push_release:
image: plugins/gitea-release
volumes: *volumes
settings:
@ -26,3 +26,15 @@ pipeline:
files: /artifacts/capture
when:
event: [tag]
docker_build_push:
image: docker:dind
secrets:
- registry_user
- registry_password
commands:
- echo "$REGISTRY_PASSWORD" | docker login -u "$REGISTRY_USER" --password-stdin
- docker build -t deblan/capture:$TAG .
- docker push deblan/capture:$TAG
when:
event: [deployment]

View file

@ -1,9 +1,12 @@
FROM golang:1.19 as builder
WORKDIR /src
COPY . .
RUN go build
FROM debian:stable-slim
RUN apt-get update && apt-get install ca-certificates -y
COPY ./capture /usr/bin/capture
WORKDIR /app
COPY --from=builder /src/capture /usr/bin/capture
ENTRYPOINT ["/usr/bin/capture"]