Skip to content

Commit

Permalink
Add Docker upgrade script
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed Oct 29, 2020
1 parent 065f95c commit cb9b9f8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
10 changes: 1 addition & 9 deletions .travis.yml
Expand Up @@ -11,15 +11,7 @@ script:
- TAG=${TRAVIS_TAG:=latest} make docker

before_script:
- sudo rm -rf /var/lib/apt/lists/*
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) edge"
- sudo apt-get update -qy
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
- mkdir -vp ~/.docker/cli-plugins/
- curl --silent -L "https://github.com/docker/buildx/releases/download/v0.3.0/buildx-v0.3.0.linux-amd64" > ~/.docker/cli-plugins/docker-buildx
- chmod a+x ~/.docker/cli-plugins/docker-buildx
- sudo systemctl start docker
- ./hack/install-docker.sh
- ./hack/install-buildx.sh

after_success:
Expand Down
12 changes: 11 additions & 1 deletion Makefile
Expand Up @@ -11,6 +11,16 @@ export DOCKER_CLI_EXPERIMENTAL=enabled
.PHONY: all
all: build

.PHONY: build-local
build-local:
@docker buildx create --use --name=multiarch --node multiarch && \
docker buildx build \
--progress=plain \
--build-arg VERSION=$(Version) --build-arg GIT_COMMIT=$(GitCommit) \
--platform linux/amd64 \
--output "type=docker,push=false" \
--tag inlets/inlets-operator:$(TAG) .

.PHONY: build
build:
@docker buildx create --use --name=multiarch --node multiarch && \
Expand All @@ -35,7 +45,7 @@ push:
docker buildx build \
--progress=plain \
--build-arg VERSION=$(Version) --build-arg GIT_COMMIT=$(GitCommit) \
--platform linux/amd64,true/arm/v6,linux/arm64 \
--platform linux/amd64,linux/arm/v6,linux/arm64 \
--output "type=image,push=true" \
--tag inlets/inlets-operator:$(TAG) .

Expand Down
14 changes: 14 additions & 0 deletions hack/install-docker.sh
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

# Source: https://www.docker.com/blog/multi-arch-build-what-about-travis/

sudo rm -rf /var/lib/apt/lists/*
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) edge"
sudo apt-get update -qy
sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
mkdir -vp ~/.docker/cli-plugins/
curl --silent -L "https://github.com/docker/buildx/releases/download/v0.3.0/buildx-v0.3.0.linux-amd64" > ~/.docker/cli-plugins/docker-buildx
chmod a+x ~/.docker/cli-plugins/docker-buildx
sudo systemctl start docker

0 comments on commit cb9b9f8

Please sign in to comment.