Skip to content

Commit 2c0e0d1

Browse files
author
Francisco Souza
committed
travis: optimize docker build
1 parent 955c5df commit 2c0e0d1

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ services:
1010
env:
1111
global:
1212
- GO_FOR_RELEASE=1.11.x
13+
- CGO_ENABLED=0
1314
go:
1415
- 1.11.x
1516
- tip
@@ -20,6 +21,7 @@ script:
2021
- unset GOPATH
2122
- export PATH=$PATH:$(go env GOPATH)/bin
2223
- make coverage
24+
- go build -o video-transcoding-api
2325
after_success:
2426
- bash <(curl -s https://codecov.io/bash)
2527
- travis-scripts/docker.bash

Dockerfile

Lines changed: 0 additions & 13 deletions
This file was deleted.

Dockerfile.ci

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This Dockerfile is intended to be used in the CI environment and depends on
2+
# an existing binary built outside Docker.
3+
4+
FROM alpine:3.8
5+
6+
RUN apk add --no-cache ca-certificates
7+
ADD video-transcoding-api /bin/video-transcoding-api
8+
CMD ["/bin/video-transcoding-api"]

travis-scripts/docker.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fi
2323
IMAGE_NAME=nytimes/video-transcoding-api
2424

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

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

0 commit comments

Comments
 (0)