Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Travis Build Multiple Docker Images from a Single Repo

Tags:

git

travis-ci

I'm trying to build Docker for multiple architectures. My repo is here:

https://github.com/mastermindg/docker-flow-proxy

I've created two Dockerfiles (amd64 and armv7). I've included the additional code into the .travis.yml.

How do I build both Docker images with a single travis yaml?

like image 242
Ken J Avatar asked Oct 19 '22 02:10

Ken J


1 Answers

Use a build matrix to build:

env:
  global:
    - VERSION=1.${TRAVIS_BUILD_NUMBER}
  matrix:
    - ARCH=x86_64
      GOIMG=golang:1.6
      DOCKER_BUILD=mastermindg/docker-flow-proxy:${VERSION}
      DOCKERFILE=Dockerfile.amd64
    - ARCH=rpi
      GOIMG=kutsudock/rpi-alpine-go
      DOCKER_BUILD=mastermindg/docker-flow-proxy:rpi-${VERSION}
      DOCKERFILE=Dockerfile.rpi

sudo: required

services:
  - docker
.................
like image 200
user3063045 Avatar answered Nov 04 '22 21:11

user3063045