feat(docker): add alpine docker image

This commit is contained in:
Bo-Yi Wu 2017-12-02 15:27:50 +08:00
parent 53b61735b1
commit 6a5e7570ad
4 changed files with 28 additions and 19 deletions

View File

@ -23,8 +23,6 @@ pipeline:
- make build - make build
# build binary for docker image # build binary for docker image
- make static_build - make static_build
when:
event: [ push, tag, pull_request ]
release: release:
image: appleboy/golang-testing image: appleboy/golang-testing
@ -34,25 +32,32 @@ pipeline:
when: when:
event: [ tag ] event: [ tag ]
docker: publish_server:
image: plugins/docker image: plugins/docker
repo: ${DRONE_REPO} group: release
tags: [ '${DRONE_TAG}' ] pull: true
secrets: [ docker_username, docker_password ] secrets: [ docker_username, docker_password ]
default_tags: true
when: when:
event: [ tag ] event: [ push, tag ]
local: false
docker: publish_alpine:
image: plugins/docker image: plugins/docker
repo: ${DRONE_REPO} group: release
tags: [ 'latest' ] pull: true
dockerfile: Dockerfile.alpine
secrets: [ docker_username, docker_password ] secrets: [ docker_username, docker_password ]
default_tags: true
default_suffix: alpine
when: when:
event: [ push ] event: [ push, tag ]
branch: [ master ] local: false
github: github:
image: plugins/github-release image: plugins/github-release
pull: true
group: release
secrets: [ github_release_api_key ] secrets: [ github_release_api_key ]
files: files:
- dist/release/* - dist/release/*

View File

@ -1,5 +1,7 @@
FROM centurylink/ca-certs FROM centurylink/ca-certs
LABEL maintainer="Bo-Yi Wu <appleboy.tw@gmail.com>"
ADD drone-telegram / ADD drone-telegram /
ENTRYPOINT ["/drone-telegram"] ENTRYPOINT ["/drone-telegram"]

10
Dockerfile.alpine Normal file
View File

@ -0,0 +1,10 @@
FROM alpine:3.6
RUN apk add -U --no-cache ca-certificates && \
rm -rf /var/cache/apk/*
LABEL maintainer="Bo-Yi Wu <appleboy.tw@gmail.com>"
ADD drone-telegram /
ENTRYPOINT ["/drone-telegram"]

View File

@ -1,8 +0,0 @@
FROM armhfbuild/alpine:3.4
RUN apk update && \
apk add ca-certificates && \
rm -rf /var/cache/apk/*
ADD drone-telegram /bin/
ENTRYPOINT ["/bin/drone-telegram"]