Skip to content

Commit

Permalink
travis: optimize docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
Francisco Souza committed Feb 11, 2019
1 parent 955c5df commit 2c0e0d1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
env:
global:
- GO_FOR_RELEASE=1.11.x
- CGO_ENABLED=0
go:
- 1.11.x
- tip
Expand All @@ -20,6 +21,7 @@ script:
- unset GOPATH
- export PATH=$PATH:$(go env GOPATH)/bin
- make coverage
- go build -o video-transcoding-api
after_success:
- bash <(curl -s https://codecov.io/bash)
- travis-scripts/docker.bash
Expand Down
13 changes: 0 additions & 13 deletions Dockerfile

This file was deleted.

8 changes: 8 additions & 0 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This Dockerfile is intended to be used in the CI environment and depends on
# an existing binary built outside Docker.

FROM alpine:3.8

RUN apk add --no-cache ca-certificates
ADD video-transcoding-api /bin/video-transcoding-api
CMD ["/bin/video-transcoding-api"]
2 changes: 1 addition & 1 deletion travis-scripts/docker.bash
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fi
IMAGE_NAME=nytimes/video-transcoding-api

docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}"
docker build -t ${IMAGE_NAME}:latest .
docker build -t ${IMAGE_NAME}:latest -f Dockerfile.ci .

if [ -n "${TRAVIS_TAG}" ]; then
docker tag ${IMAGE_NAME}:latest ${IMAGE_NAME}:${TRAVIS_TAG}
Expand Down

0 comments on commit 2c0e0d1

Please sign in to comment.