Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
6276e01435 |
24
.drone.yml
24
.drone.yml
@ -4,35 +4,21 @@ type: docker
|
|||||||
name: default
|
name: default
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build docker image (alpine)
|
- name: build docker image
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
environment:
|
environment:
|
||||||
DOCKER_BUILDKIT: '1'
|
DOCKER_BUILDKIT: '1'
|
||||||
settings:
|
settings:
|
||||||
purge: true
|
purge: true
|
||||||
repo: otakukaze/golang-base-image
|
repo: otakukaze/golang-base-image
|
||||||
|
tags:
|
||||||
|
- "${DRONE_BRANCH}"
|
||||||
username: otakukaze
|
username: otakukaze
|
||||||
password:
|
password:
|
||||||
from_secret: password
|
from_secret: password
|
||||||
tags:
|
build_args:
|
||||||
- "${DRONE_BRANCH}"
|
- "IMG_TAG=${DRONE_BRANCH}"
|
||||||
when:
|
when:
|
||||||
ref:
|
ref:
|
||||||
- refs/heads/1-alpine
|
- 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
|
|
||||||
|
14
Dockerfile
14
Dockerfile
@ -1,11 +1,5 @@
|
|||||||
ARG IMG_TAG=1
|
ARG IMG_TAG=1-alpine
|
||||||
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}
|
FROM golang:${IMG_TAG}
|
||||||
COPY --from=builder /go/bin/swagger /usr/bin
|
RUN apk add --no-cache git make gcc libc-dev \
|
||||||
COPY --from=builder /go/bin/go-bindata /usr/bin
|
&& go get -u github.com/go-bindata/go-bindata/... \
|
||||||
|
&& go get -u github.com/go-swagger/go-swagger/...
|
||||||
|
Loading…
Reference in New Issue
Block a user