Compare commits

..

6 Commits

Author SHA1 Message Date
Jay
434ec873dd change swagger build
All checks were successful
continuous-integration/drone/push Build is passing
2021-01-19 00:54:36 +08:00
Jay
0c7c9334ef [feat] change to multi stage build
All checks were successful
continuous-integration/drone/push Build is passing
2021-01-04 23:10:48 +08:00
Jay
8aea07cf6e [feat] move bin to usr/bin
All checks were successful
continuous-integration/drone/push Build is passing
2021-01-04 23:04:31 +08:00
Jay
aaa5e4c85a fix
Some checks failed
continuous-integration/drone/push Build is failing
2020-12-09 01:10:46 +08:00
Jay
eaa0980acd update
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2020-12-09 01:10:21 +08:00
Jay
455a63aecc change to debian base
All checks were successful
continuous-integration/drone/push Build is passing
2020-12-09 01:08:27 +08:00
2 changed files with 29 additions and 9 deletions

View File

@ -4,21 +4,35 @@ type: docker
name: default
steps:
- name: build docker image
- name: build docker image (alpine)
image: plugins/docker
environment:
DOCKER_BUILDKIT: '1'
settings:
purge: true
repo: otakukaze/golang-base-image
tags:
- "${DRONE_BRANCH}"
username: otakukaze
password:
from_secret: password
build_args:
- "IMG_TAG=${DRONE_BRANCH}"
tags:
- "${DRONE_BRANCH}"
when:
ref:
- refs/heads/1-alpine
- name: build docker image (debian)
image: plugins/docker
environment:
DOCKER_BUILDKIT: '1'
settings:
purge: true
repo: otakukaze/golang-base-image
username: otakukaze
password:
from_secret: password
tags:
- "1"
- "latest"
when:
ref:
- refs/heads/master

View File

@ -1,5 +1,11 @@
ARG IMG_TAG=1-alpine
ARG IMG_TAG=1
FROM golang:${IMG_TAG} as builder
RUN go get -u -v github.com/go-bindata/go-bindata/... \
&& dir=$(mktemp -d) \
&& git clone https://github.com/go-swagger/go-swagger "$dir" \
&& cd "$dir" \
&& go install ./cmd/swagger
FROM golang:${IMG_TAG}
RUN apk add --no-cache git make gcc libc-dev \
&& go get -u github.com/go-bindata/go-bindata/... \
&& go get -u github.com/go-swagger/go-swagger/...
COPY --from=builder /go/bin/swagger /usr/bin
COPY --from=builder /go/bin/go-bindata /usr/bin