I am trying to a multiarch docker container with CICD using Travis ci
Travis already creates and pushed the Container into Dockerhub → but only AMD64 and I want to run it on my Raspberry either.
What is the best way to do so?
#we use java
language: java
#we add the java development kit (jdk)
jdk:
- openjdk8
matrix:
include:
- os: linux
dist: xenial
arch: amd64
jdk: openjdk8
- os: linux
dist: trusty
arch: rpi
jdk: openjdk8
before_install:
- sudo apt-get -yq install maven
os: linux
virt: vm
services:
#Linking Travis CI and Docker
- docker
before_install:
- mvn clean
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker pull openjdk:8-jdk-alpine
script:
#We avoid this error :" the job exceeded the maximum log length and has been terminated "
- cp .travis.settings.xml $HOME/.m2/settings.xml
- cat $HOME/.m2/settings.xml
#deploying the app on Docker
- mvn deploy
In my opinion I’d have to change something in mvn deploy but I can’t find anything like that on Google
There’s no such thing as “arch:rpi”. See the documentation page for valid values.
See if there are any warnings or errors on the “config” tab of the build page.
Also check your .travis.yml at https://config.travis-ci.com/explore to see the intended resulting build matrix.
Please link to a build for me to be able to say anything else.
I’ve confirmed the problem. For some reason, JDK 8 cannot install in an ARM64 builder.
Until the problem is solved, you can work around it by adding this to your .travis.yml (before any other commands in the before_install: section if you already have one):
before_install:
- |
if [[ $TRAVIS_CPU_ARCH == "arm64" ]]; then
travis_install_jdk_package() {
local JAVA_VERSION
JAVA_VERSION="$1"
sudo apt-get update -y
PACKAGE="adoptopenjdk-${JAVA_VERSION}-hotspot"
if ! dpkg -s "$PACKAGE" >/dev/null 2>&1; then
if dpkg-query -l adoptopenjdk* ; then
dpkg-query -l adoptopenjdk* | grep adoptopenjdk | awk '{print $2}' | xargs sudo dpkg -P
fi
wget -nv -O - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
sudo apt-get update -yq
sudo apt-get -yq --no-install-suggests --no-install-recommends install "$PACKAGE" || true
sudo update-java-alternatives -s "$PACKAGE"*
if ! dpkg-query -l maven &>/dev/null; then sudo apt-get -yq install maven; fi
fi
}
travis_install_jdk_package 8
fi