Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish alpine container #398

Merged
merged 12 commits into from
Oct 4, 2021
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 41 additions & 39 deletions .woodpecker/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,84 +50,86 @@ pipeline:
- (cd web/; go generate ./...)
- make release

# publish-server-alpine:
# image: plugins/docker
# repo: woodpeckerci/woodpecker-server
# dockerfile: Dockerfile.alpine
# secrets: [ docker_username, docker_password ]
# tag: [ alpine ]
# when:
# branch: master
# event: push

build-cli:
image: golang:1.16
commands: make release-cli

publish-server:
image: plugins/docker
repo: woodpeckerci/woodpecker-server
dockerfile: docker/Dockerfile.server
secrets: [docker_username, docker_password]
tag: [latest]
6543 marked this conversation as resolved.
Show resolved Hide resolved
when:
branch: master
event: push

publish-server-alpine:
image: plugins/docker
repo: woodpeckerci/woodpecker-server
dockerfile: docker/Dockerfile.server.alpine
secrets: [ docker_username, docker_password ]
tag: [latest-alpine]
6543 marked this conversation as resolved.
Show resolved Hide resolved
when:
branch: master
event: push

publish-agent:
image: plugins/docker
repo: woodpeckerci/woodpecker-agent
dockerfile: Dockerfile.agent
dockerfile: docker/Dockerfile.agent
secrets: [docker_username, docker_password]
tag: [latest]
6543 marked this conversation as resolved.
Show resolved Hide resolved
when:
branch: master
event: push

# publish-agent-alpine:
# image: plugins/docker
# repo: woodpeckerci/woodpecker-agent
# dockerfile: Dockerfile.agent.alpine
# secrets: [ docker_username, docker_password ]
# tag: [ alpine ]
# when:
# branch: master
# event: push

# release-server-alpine:
# image: plugins/docker
# repo: woodpeckerci/woodpecker-server
# dockerfile: Dockerfile.alpine
# secrets: [ docker_username, docker_password ]
# tag: "${DRONE_TAG}-alpine"
# when:
# event: tag
#
# release-agent-alpine:
# image: plugins/docker
# repo: woodpeckerci/woodpecker-agent
# dockerfile: Dockerfile.agent.alpine
# secrets: [ docker_username, docker_password ]
# tag: "${DRONE_TAG}-alpine"
# when:
# event: tag
publish-agent-alpine:
image: plugins/docker
repo: woodpeckerci/woodpecker-agent
dockerfile: docker/Dockerfile.agent.alpine
secrets: [ docker_username, docker_password ]
tag: [latest-alpine]
6543 marked this conversation as resolved.
Show resolved Hide resolved
when:
branch: master
event: push

release-server:
image: plugins/docker
repo: woodpeckerci/woodpecker-server
dockerfile: docker/Dockerfile.server
secrets: [docker_username, docker_password]
tag: ${DRONE_TAG}
6543 marked this conversation as resolved.
Show resolved Hide resolved
when:
event: tag

release-server-alpine:
image: plugins/docker
repo: woodpeckerci/woodpecker-server
dockerfile: docker/Dockerfile.server.alpine
secrets: [ docker_username, docker_password ]
tag: "${DRONE_TAG}-alpine"
6543 marked this conversation as resolved.
Show resolved Hide resolved
when:
event: tag

release-agent:
image: plugins/docker
repo: woodpeckerci/woodpecker-agent
dockerfile: Dockerfile.agent
dockerfile: docker/Dockerfile.agent
secrets: [docker_username, docker_password]
tag: ${DRONE_TAG}
6543 marked this conversation as resolved.
Show resolved Hide resolved
when:
event: tag

release-agent-alpine:
image: plugins/docker
repo: woodpeckerci/woodpecker-agent
dockerfile: docker/Dockerfile.agent.alpine
secrets: [ docker_username, docker_password ]
tag: "${DRONE_TAG}-alpine"
6543 marked this conversation as resolved.
Show resolved Hide resolved
when:
event: tag

release-cli:
image: plugins/github-release
files:
Expand Down
19 changes: 0 additions & 19 deletions BUILDING

This file was deleted.

13 changes: 0 additions & 13 deletions Dockerfile

This file was deleted.

10 changes: 0 additions & 10 deletions Dockerfile.agent

This file was deleted.

17 changes: 17 additions & 0 deletions docker/Dockerfile.agent
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# docker build --rm -f docker/Dockerfile.agent -t woodpeckerci/woodpecker-agent .

# use golang image to copy ssl certs later
FROM golang:1.16

FROM scratch

# copy certs from golang:1.16 image
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

ENV GODEBUG=netdns=go
ADD release/woodpecker-agent /bin/

EXPOSE 3000
HEALTHCHECK CMD ["/bin/woodpecker-agent", "ping"]

ENTRYPOINT ["/bin/woodpecker-agent"]
4 changes: 2 additions & 2 deletions Dockerfile.agent.alpine → docker/Dockerfile.agent.alpine
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM alpine:3.9.4
# docker build --rm -f docker/Dockerfile.agent.alpine -t woodpeckerci/woodpecker-agent .

FROM alpine:3.14
RUN apk add -U --no-cache ca-certificates

ENV GODEBUG=netdns=go
Expand All @@ -9,4 +10,3 @@ EXPOSE 3000
HEALTHCHECK CMD ["/bin/woodpecker-agent", "ping"]

ENTRYPOINT ["/bin/woodpecker-agent"]

20 changes: 20 additions & 0 deletions docker/Dockerfile.server
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# docker build --rm -f docker/Dockerfile.server -t woodpeckerci/woodpecker-server .

# use golang image to copy ssl certs later
FROM golang:1.16

FROM scratch

# copy certs from golang:1.16 image
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

EXPOSE 8000 9000 80 443

ENV GODEBUG=netdns=go
ENV WOODPECKER_DATABASE_DATASOURCE=/var/lib/drone/drone.sqlite
ENV WOODPECKER_DATABASE_DRIVER=sqlite3
ENV XDG_CACHE_HOME=/var/lib/drone

ADD release/woodpecker-server /bin/

ENTRYPOINT ["/bin/woodpecker-server"]
6 changes: 4 additions & 2 deletions Dockerfile.alpine → docker/Dockerfile.server.alpine
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM alpine:3.9.4
EXPOSE 8000 9000 80 443
# docker build --rm -f docker/Dockerfile.server.alpine -t woodpeckerci/woodpecker-server .

FROM alpine:3.14
RUN apk add -U --no-cache ca-certificates

EXPOSE 8000 9000 80 443

ENV GODEBUG=netdns=go
ENV WOODPECKER_DATABASE_DATASOURCE=/var/lib/drone/drone.sqlite
ENV WOODPECKER_DATABASE_DRIVER=sqlite3
Expand Down