@cryptotaxi247 / netdata-1 / commits / 77180a429

Explicitly set platform for Docker builds. (#10357)

Needed to accomodate our new handling of our base and builder images.

Austin S. Hemmelgarn committed Dec 9, 2020 at 16:27 UTC 77180a42968a992cfc75384a34f873566d3f2aff
3 files changed +30 -9
.github/workflows/docker.yml
+10 -1
@@ -23,6 +23,15 @@ jobs:
23 - i386
24 - armhf
25 - aarch64
26 + include:
27 + - arch: amd64
28 + platform: linux/amd64
29 + - arch: i386
30 + platform: linux/i386
31 + - arch: armhf
32 + platform: linux/arm/v7
33 + - arch: aarch64
34 + platform: linux/arm64
35 runs-on: ubuntu-latest
36 steps:
37 - name: Checkout
@@ -32,4 +41,4 @@ jobs:
41 docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
42 - name: Test Docker Build
43 run:
35 - docker build --build-arg ARCH=${{ matrix.arch }} -f packaging/docker/Dockerfile .
44 + docker build --build-arg ARCH=${{ matrix.arch }} --platform ${{ matrix.platform }} -f packaging/docker/Dockerfile .
.travis.yml
+12 -8
@@ -1,5 +1,5 @@
1 ---
2 -dist: bionic
2 +dist: focal
3 language: c
4
5 addons:
@@ -17,7 +17,7 @@ before_install:
17 # Install dependencies for all, once
18 #
19 install:
20 - - sudo apt-get install -y libuv1-dev liblz4-dev libjudy-dev libcap2-bin zlib1g-dev uuid-dev fakeroot libipmimonitoring-dev libmnl-dev libnetfilter-acct-dev gnupg python-pip
20 + - sudo apt-get install -y libuv1-dev liblz4-dev libjudy-dev libcap2-bin zlib1g-dev uuid-dev fakeroot libipmimonitoring-dev libmnl-dev libnetfilter-acct-dev gnupg python3-pip
21 - sudo pip install git-semver==0.2.4 # 11/Sep/2019: git-semver tip was broken, so we had to force last good run of it
22 - source tests/installer/slack.sh
23 - export NOTIF_CHANNEL="automation-beta"
@@ -104,12 +104,14 @@ jobs:
104 after_failure: post_message "TRAVIS_MESSAGE" "<!here> standard netdata build is failing (Still dont know which one, will improve soon)"
105
106 - name: Docker container build process (alpine installation)
107 - script: packaging/docker/build.sh
107 + script:
108 + - "sudo echo '{\"experimental\": true}' > /etc/docker/daemon.json && sudo systemctl restart docker"
109 + - packaging/docker/build.sh
110 env:
111 - ARCH=amd64
112 after_failure: post_message "TRAVIS_MESSAGE" "Docker build process failed"
113
112 - - name: Build/Install for ubuntu 18.04 (not containerized)
114 + - name: Build/Install for ubuntu 20.04 (not containerized)
115 script: fakeroot ./netdata-installer.sh --dont-wait --dont-start-it --install $HOME
116 after_failure: post_message "TRAVIS_MESSAGE" "Build/Install failed on ubuntu 18.04"
117
@@ -121,7 +123,7 @@ jobs:
123 git:
124 depth: false
125 before_install:
124 - - sudo apt-get install -y wget lxc python3-lxc python-lxc lxc-templates dh-make git-buildpackage build-essential libdistro-info-perl
126 + - sudo apt-get install -y wget lxc python3-lxc lxc-templates dh-make git-buildpackage build-essential libdistro-info-perl
127 before_script:
128 - export PACKAGES_DIRECTORY="$(mktemp -d -t netdata-packaging-contents-dir-XXXXXX)" && echo "Created packaging directory ${PACKAGES_DIRECTORY}"
129 script:
@@ -143,7 +145,7 @@ jobs:
145 git:
146 depth: false
147 before_install:
146 - - sudo apt-get install -y wget lxc lxc-templates python3-lxc python-lxc
148 + - sudo apt-get install -y wget lxc lxc-templates python3-lxc
149 before_script:
150 - export PACKAGES_DIRECTORY="$(mktemp -d -t netdata-packaging-contents-dir-XXXXXX)" && echo "Created packaging directory ${PACKAGES_DIRECTORY}"
151 script:
@@ -186,7 +188,7 @@ jobs:
188 git:
189 depth: false
190 before_install:
189 - - sudo apt-get install -y wget lxc python3-lxc python-lxc lxc-templates dh-make git-buildpackage build-essential libdistro-info-perl
191 + - sudo apt-get install -y wget lxc python3-lxc lxc-templates dh-make git-buildpackage build-essential libdistro-info-perl
192 - source tests/installer/slack.sh
193 before_script:
194 - export PACKAGES_DIRECTORY="$(mktemp -d -t netdata-packaging-contents-dir-XXXXXX)" && echo "Created packaging directory ${PACKAGES_DIRECTORY}"
@@ -273,7 +275,7 @@ jobs:
275 git:
276 depth: false
277 before_install:
276 - - sudo apt-get install -y wget lxc lxc-templates python3-lxc python-lxc
278 + - sudo apt-get install -y wget lxc lxc-templates python3-lxc
279 - source tests/installer/slack.sh
280 before_script:
281 - export PACKAGES_DIRECTORY="$(mktemp -d -t netdata-packaging-contents-dir-XXXXXX)" && echo "Created packaging directory ${PACKAGES_DIRECTORY}"
@@ -361,6 +363,7 @@ jobs:
363 - echo "Last commit:" && git log -1
364 - echo "GIT Describe:" && git describe
365 - echo "packaging/version:" && cat packaging/version
366 + - "sudo echo '{\"experimental\": true}' > /etc/docker/daemon.json && sudo systemctl restart docker"
367 - packaging/docker/check_login.sh
368 && echo "Switching to latest master branch, to pick up tagging if any" && git checkout master && git pull
369 && tick packaging/docker/build.sh
@@ -443,6 +446,7 @@ jobs:
446 - echo "Last commit:" && git log -1
447 - echo "GIT Describe:" && git describe
448 - echo "packaging/version:" && cat packaging/version
449 + - "sudo echo '{\"experimental\": true}' > /etc/docker/daemon.json && sudo systemctl restart docker"
450 - packaging/docker/check_login.sh
451 && tick packaging/docker/build.sh
452 && packaging/docker/publish.sh
packaging/docker/build.sh
+8
@@ -52,6 +52,13 @@ if [ ! -z $CWD ] || [ ! "${TOP_LEVEL}" == "netdata" ]; then
52 exit 1
53 fi
54
55 +case "${ARCH}" in
56 + amd64) DOCKER_PLATFORM="linux/amd64" ;;
57 + i386) DOCKER_PLATFORM="linux/i386" ;;
58 + armhf) DOCKER_PLATFORM="linux/arm/v7" ;;
59 + aarch64) DOCKER_PLATFORM="linux/arm64" ;;
60 +esac
61 +
62 echo "Docker image build in progress.."
63 echo "Version : ${VERSION}"
64 echo "Repository : ${REPOSITORY}"
@@ -65,6 +72,7 @@ echo "Building tag ${TAG}.."
72 docker build --no-cache \
73 --build-arg ARCH="${ARCH}" \
74 --build-arg RELEASE_CHANNEL="${RELEASE_CHANNEL}" \
75 + --platform "${DOCKER_PLATFORM}" \
76 --tag "${TAG}" \
77 --file packaging/docker/Dockerfile .
78 echo "..Done!"