From 25ef18dae17d1adff8247c2b54e0b2d664230e33 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 20 Feb 2018 13:58:56 -0500 Subject: [PATCH 1/8] use autotag --- .drone.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 3786677..e951bc2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,13 +7,19 @@ pipeline: image: golang:1.9 commands: sh .drone.sh - snapshot: + publish_latest: image: plugins/docker repo: drone/cli secrets: [docker_username, docker_password] - when: - branch: master - event: push + auto_tag: true + + publish_alpine: + image: plugins/docker + repo: drone/cli + secrets: [docker_username, docker_password] + auto_tag: true + auto_tag_suffix: alpine + dockerfile: Dockerfile.alpine release: image: plugins/github-release From a740baab1260901b363872ea31125c844aba82bf Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 20 Feb 2018 13:59:04 -0500 Subject: [PATCH 2/8] add alpine dockerfile --- Dockerfile.alpine | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Dockerfile.alpine diff --git a/Dockerfile.alpine b/Dockerfile.alpine new file mode 100644 index 0000000..d498d81 --- /dev/null +++ b/Dockerfile.alpine @@ -0,0 +1,7 @@ +FROM alpine:3.7 + +RUN apk add -U --no-cache ca-certificates + +ADD release/linux/amd64/drone /bin/ + +ENTRYPOINT ["/bin/drone"] From be8ed847db7b4122a3004cc9aba7619c5b65fc32 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 20 Feb 2018 14:12:02 -0500 Subject: [PATCH 3/8] add arm publish steps --- .drone.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.drone.yml b/.drone.yml index e951bc2..6675f1a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -21,6 +21,22 @@ pipeline: auto_tag_suffix: alpine dockerfile: Dockerfile.alpine + publish_arm: + image: plugins/docker + repo: drone/cli + secrets: [docker_username, docker_password] + auto_tag: true + auto_tag_suffix: arm + dockerfile: Dockerfile.arm + + publish_arm64: + image: plugins/docker + repo: drone/cli + secrets: [docker_username, docker_password] + auto_tag: true + auto_tag_suffix: arm64 + dockerfile: Dockerfile.arm64 + release: image: plugins/github-release files: From a7e4c4147b80dd5667d5bfdcc538095e34d40f20 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 20 Feb 2018 14:12:09 -0500 Subject: [PATCH 4/8] add arm dockerfiles --- Dockerfile.arm | 5 +++++ Dockerfile.arm64 | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 Dockerfile.arm create mode 100644 Dockerfile.arm64 diff --git a/Dockerfile.arm b/Dockerfile.arm new file mode 100644 index 0000000..86a037d --- /dev/null +++ b/Dockerfile.arm @@ -0,0 +1,5 @@ +FROM drone/ca-certs + +ADD release/linux/arm/drone /bin/ + +ENTRYPOINT ["/bin/drone"] diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 new file mode 100644 index 0000000..7b2d367 --- /dev/null +++ b/Dockerfile.arm64 @@ -0,0 +1,6 @@ +FROM drone/ca-certs + +ADD release/linux/arm64/drone /bin/ + +ENTRYPOINT ["/bin/drone"] + From fba0375e962b88a8961b51e8723dcf001acc7c0d Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 20 Feb 2018 14:16:06 -0500 Subject: [PATCH 5/8] use COPY instead of ADD --- Dockerfile | 2 +- Dockerfile.alpine | 2 +- Dockerfile.arm | 2 +- Dockerfile.arm64 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 573c703..1489f55 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM drone/ca-certs -ADD release/linux/amd64/drone /bin/ +COPY release/linux/amd64/drone /bin/ ENTRYPOINT ["/bin/drone"] diff --git a/Dockerfile.alpine b/Dockerfile.alpine index d498d81..0a370c7 100644 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -2,6 +2,6 @@ FROM alpine:3.7 RUN apk add -U --no-cache ca-certificates -ADD release/linux/amd64/drone /bin/ +COPY release/linux/amd64/drone /bin/ ENTRYPOINT ["/bin/drone"] diff --git a/Dockerfile.arm b/Dockerfile.arm index 86a037d..1091c58 100644 --- a/Dockerfile.arm +++ b/Dockerfile.arm @@ -1,5 +1,5 @@ FROM drone/ca-certs -ADD release/linux/arm/drone /bin/ +COPY release/linux/arm/drone /bin/ ENTRYPOINT ["/bin/drone"] diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index 7b2d367..1ce230f 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -1,6 +1,6 @@ FROM drone/ca-certs -ADD release/linux/arm64/drone /bin/ +COPY release/linux/arm64/drone /bin/ ENTRYPOINT ["/bin/drone"] From dd760628a2fe79978478b4ce1a86243a828a643a Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 20 Feb 2018 14:58:13 -0500 Subject: [PATCH 6/8] add conditions to docker plugin --- .drone.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.drone.yml b/.drone.yml index 6675f1a..4208a9e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,6 +12,8 @@ pipeline: repo: drone/cli secrets: [docker_username, docker_password] auto_tag: true + when: + event: [push, tag] publish_alpine: image: plugins/docker @@ -20,6 +22,8 @@ pipeline: auto_tag: true auto_tag_suffix: alpine dockerfile: Dockerfile.alpine + when: + event: [push, tag] publish_arm: image: plugins/docker @@ -28,6 +32,8 @@ pipeline: auto_tag: true auto_tag_suffix: arm dockerfile: Dockerfile.arm + when: + event: [push, tag] publish_arm64: image: plugins/docker @@ -36,6 +42,8 @@ pipeline: auto_tag: true auto_tag_suffix: arm64 dockerfile: Dockerfile.arm64 + when: + event: [push, tag] release: image: plugins/github-release From 9cac4bf0f1960d037cd1c6f32cd36d2ed2d1cffd Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 20 Feb 2018 18:20:59 -0500 Subject: [PATCH 7/8] add linux prefix for arm --- .drone.yml | 12 ++++++------ Dockerfile.arm => Dockerfile.linux.arm | 0 Dockerfile.arm64 => Dockerfile.linux.arm64 | 0 3 files changed, 6 insertions(+), 6 deletions(-) rename Dockerfile.arm => Dockerfile.linux.arm (100%) rename Dockerfile.arm64 => Dockerfile.linux.arm64 (100%) diff --git a/.drone.yml b/.drone.yml index 4208a9e..14afd6c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -25,23 +25,23 @@ pipeline: when: event: [push, tag] - publish_arm: + publish_linux_arm: image: plugins/docker repo: drone/cli secrets: [docker_username, docker_password] auto_tag: true - auto_tag_suffix: arm - dockerfile: Dockerfile.arm + auto_tag_suffix: linux-arm + dockerfile: Dockerfile.linux.arm when: event: [push, tag] - publish_arm64: + publish_linux_arm64: image: plugins/docker repo: drone/cli secrets: [docker_username, docker_password] auto_tag: true - auto_tag_suffix: arm64 - dockerfile: Dockerfile.arm64 + auto_tag_suffix: linux-arm64 + dockerfile: Dockerfile.linux.arm64 when: event: [push, tag] diff --git a/Dockerfile.arm b/Dockerfile.linux.arm similarity index 100% rename from Dockerfile.arm rename to Dockerfile.linux.arm diff --git a/Dockerfile.arm64 b/Dockerfile.linux.arm64 similarity index 100% rename from Dockerfile.arm64 rename to Dockerfile.linux.arm64 From 75787cef643c4c70aae9d42c5bd1e9127bf0174c Mon Sep 17 00:00:00 2001 From: Tony Li Date: Wed, 21 Feb 2018 20:12:30 -0500 Subject: [PATCH 8/8] fetch apk once (#84) --- Dockerfile.alpine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.alpine b/Dockerfile.alpine index 0a370c7..3f91a12 100644 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -1,6 +1,6 @@ FROM alpine:3.7 -RUN apk add -U --no-cache ca-certificates +RUN apk add --no-cache ca-certificates COPY release/linux/amd64/drone /bin/