-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alpine docker build fails #480
Comments
Github Copliot tells me to check if this Boost version is compatible with this Conan version? 🤷 Any other ideas? |
Builds fine using build and on Ubuntu, so I dont think it has anything to do with the boost version. The boost version is also coming from ConanCentral so it has been tested on all the platforms. It also passes the CI/CD tests on three platforms.
I think this is a buildx bug. It sometimes dies in the libxml or other builds. Rather random.
Using build for Alpine docker image works fine on the host arch. I think this is a qemu issue with alpine when using buildx. That is as much as I can surmise at this point.
|
something clearly changed |
Try changing qemu versions or docket buildx. That's where I left off. Went through all the obvious settings like you, no luck. I think it is the cross compile environment that is killing the build. Can't think of anything else. |
i must be reading my action's logs wrong; im reading that my runs are failing building linux/amd64? |
yup - its the amd64 build that is failing, not arm64. Which is even weirder. cross-compile works, but native arch doesnt? 🤔 🤷 I removed # build docker image and push to docker hub
# note: this won't work because the cross-platform build takes around 10h,
# but github limits us to 6h.
# so need to build it locally and push to docker hub.
# see Dockerfile for instructions.
# needs github secrets set for -
# DOCKERHUB_USERNAME - ie mtconnect
# DOCKERHUB_TOKEN - token for that account
# Set VERSION below before building.
# See CMakeLists.txt for the current version.
# Note: this will tag the image with that version, as well as 'latest'.
name: Build Docker image
env:
PLATFORMS: linux/arm64
# when to run workflow
on:
# # run on push or pull request events for the master branch
push:
tags:
- "v*.*.*"
# allows you to run this workflow manually from the actions tab
workflow_dispatch:
# a workflow run has one or more jobs that can run sequentially or in parallel
jobs:
# this workflow contains a single job called "build"
build:
# the type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
include:
- dockerfile: docker/alpine/Dockerfile
name: agent
# - dockerfile: demo/Dockerfile
# name: demo
# steps represent a sequence of tasks that will be executed as part of the job
steps:
# checks-out your repository under $GITHUB_WORKSPACE
# see https://github.com/actions/checkout
- name: Checkout Agent
uses: actions/checkout@v3
# the QEMU emulator lets us build for arm processors also
# see https://github.com/docker/setup-qemu-action
- name: Set up QEMU emulator
uses: docker/setup-qemu-action@v3
# see https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Remove leading v from the version
run: |
echo "VERSION=$(echo ${{ github.ref_name }} | sed 's/^v//')" >> $GITHUB_ENV
echo "MAJOR_VERSION=$(echo ${{ github.ref_name }} | sed -E 's/^v([0-9]+)\.([0-9]+)\..+/\1.\2/')" >> $GITHUB_ENV
# see https://github.com/docker/build-push-action
- name: Build image and push to DockerHub
uses: docker/build-push-action@v5
with:
context: .
file: ${{ matrix.dockerfile }}
platforms: ${{ env.PLATFORMS }}
# docker hub user/repo:tag
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.name }}:latest
${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.name }}:${{ env.VERSION }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.name }}:${{ env.MAJOR_VERSION }}
# push to docker hub
push: true |
I have the reverse because I'm building on a Mac M1. Arm builds Amd fails. |
Not sure if we can build on GitHub using ARM architecture and then push using build instead of buildx. |
We looked into that recently, I don't believe github offers anything other than amd64 runners. You can host your own runner, which can be arm. However that all but defeats the point of using github actions cloud |
Looks like public github-hosted arm runners are coming "this year" : |
I was wondering if the MacOS runner is ARM based. |
Looks like they entered private beta in Jan. Maybe the my are now available. |
we are building both amd and arm, into alpine images, with qemu on github for our other projects, and they build fine. so this is something to do with conan/boost build process in qemu |
Or a more complex build. |
For now, I am building the alpine image for arm64 in my fork since it appears the amd64 is what is failing, arm64 seems to build fine. if anyone wants/needs alpine image sizes for arm64, you can find it here: https://hub.docker.com/repository/docker/robotranger/agent/general |
Cross compiling in docker is broken for the moment in alpine. I have tried to work around it and have had no success. If you find a solution, please post it. |
The crazy thing is the cross compiling is the part that is working! ARM64 builds fine. AMD64 is failing. Just so I don't duplicate work, have we tried building AMD WITHOUT qemu? |
Builds without buildx have been working on both platforms without qemu.
|
Formal issue stemming from discussion here: https://github.com/orgs/mtconnect/discussions/476
Only seems to affect Alpine/arm64.
Alpine w/o buildx works fine.
Ubuntu images build successfully.
Alpine docker build fails. Here is the github action error from my own fork:
The text was updated successfully, but these errors were encountered: