mirror of
https://github.com/frappe/frappe_docker.git
synced 2024-12-24 11:05:29 +00:00
ci: build multi arch images
This commit is contained in:
parent
94f667caeb
commit
948e1bf00a
15
.travis.yml
15
.travis.yml
@ -11,12 +11,25 @@ services:
|
|||||||
- docker
|
- docker
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
|
# Install latest docker (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
|
||||||
|
- 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.5.1/buildx-v0.5.1.linux-amd64" > ~/.docker/cli-plugins/docker-buildx
|
||||||
|
- chmod a+x ~/.docker/cli-plugins/docker-buildx
|
||||||
|
- docker buildx create --use
|
||||||
|
|
||||||
- if [[ "$BUILD" != "development" ]]; then
|
- if [[ "$BUILD" != "development" ]]; then
|
||||||
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin;
|
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin;
|
||||||
sudo apt-get update && sudo apt-get -y install git;
|
sudo apt-get update && sudo apt-get -y install git;
|
||||||
fi
|
fi
|
||||||
- if [[ $BUILD == "development" ]];then
|
- if [[ $BUILD == "development" ]];then
|
||||||
sudo apt-get update && sudo apt-get -y install docker-compose;
|
sudo apt-get update && sudo apt-get -y install curl;
|
||||||
|
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose;
|
||||||
|
sudo chmod +x /usr/local/bin/docker-compose;
|
||||||
fi
|
fi
|
||||||
- chmod u+x ./travis.py
|
- chmod u+x ./travis.py
|
||||||
|
|
||||||
|
@ -40,6 +40,8 @@ RUN apt-get update -y && apt-get install \
|
|||||||
wait-for-it \
|
wait-for-it \
|
||||||
# For arm64
|
# For arm64
|
||||||
gcc -y \
|
gcc -y \
|
||||||
|
&& if [ `uname -m` = 'aarch64' ]; then export ARCH=arm64; fi \
|
||||||
|
&& if [ `uname -m` = 'x86_64' ]; then export ARCH=amd64; fi \
|
||||||
&& wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_${ARCH}.deb \
|
&& wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_${ARCH}.deb \
|
||||||
&& dpkg -i wkhtmltox_0.12.6-1.buster_${ARCH}.deb && rm wkhtmltox_0.12.6-1.buster_${ARCH}.deb \
|
&& dpkg -i wkhtmltox_0.12.6-1.buster_${ARCH}.deb && rm wkhtmltox_0.12.6-1.buster_${ARCH}.deb \
|
||||||
&& wget https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh \
|
&& wget https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh \
|
||||||
|
@ -44,7 +44,7 @@ def build(service, tag, image, branch):
|
|||||||
build_args += f' --build-arg NODE_IMAGE_TAG=10-buster-slim'
|
build_args += f' --build-arg NODE_IMAGE_TAG=10-buster-slim'
|
||||||
|
|
||||||
print(f'Building {service} {image} image')
|
print(f'Building {service} {image} image')
|
||||||
subprocess.run(f'docker build {build_args} -t {service}-{image} -f build/{service}-{image}/Dockerfile .', shell=True)
|
subprocess.run(f'docker buildx build --platform linux/amd64,linux/arm64 --load {build_args} -t {service}-{image} -f build/{service}-{image}/Dockerfile .', shell=True)
|
||||||
tag_and_push(f'{service}-{image}', tag)
|
tag_and_push(f'{service}-{image}', tag)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user