Support multi-stage docker build. (#229)
* support multi-stage docker image. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * update docker image Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * test docker image. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * test docker image. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * fix image name Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * update tag Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * update drone config. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
2a6bd3a311
commit
96b5fb4921
|
@ -23,8 +23,6 @@ pipeline:
|
|||
- coverage all
|
||||
# send coverage report
|
||||
- make coverage
|
||||
# build binary for docker image
|
||||
- make docker_build
|
||||
|
||||
release:
|
||||
image: appleboy/golang-testing
|
||||
|
@ -40,6 +38,7 @@ pipeline:
|
|||
|
||||
publish_latest:
|
||||
image: plugins/docker
|
||||
pull: true
|
||||
repo: ${DRONE_REPO}
|
||||
tags: [ 'latest' ]
|
||||
secrets: [ docker_username, docker_password ]
|
||||
|
@ -50,6 +49,7 @@ pipeline:
|
|||
|
||||
publish_tag:
|
||||
image: plugins/docker
|
||||
pull: true
|
||||
repo: ${DRONE_REPO}
|
||||
tags: [ '${DRONE_TAG}' ]
|
||||
secrets: [ docker_username, docker_password ]
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
# build stage
|
||||
FROM appleboy/golang-testing AS build-env
|
||||
ADD . /go/src/github.com/appleboy/gorush
|
||||
RUN cd /go/src/github.com/appleboy/gorush && make docker_build
|
||||
|
||||
# final stage
|
||||
FROM centurylink/ca-certs
|
||||
EXPOSE 8088
|
||||
|
||||
ADD config/config.yml /
|
||||
ADD bin/gorush /
|
||||
COPY --from=build-env /go/src/github.com/appleboy/gorush/bin/gorush /
|
||||
|
||||
ENTRYPOINT ["/gorush"]
|
||||
CMD ["-c", "config.yml"]
|
||||
|
|
Loading…
Reference in New Issue