Skip to content

QEMU simulated arm64 and ran the libc-bin configuration script with a segmentation fault(qemu-v9.2.0-51) #201

Closed
@IabSDocker

Description

@IabSDocker

Contributing guidelines

I've found a bug, and:

  • The documentation does not mention anything about my problem
  • There are no open or closed issues that are related to my problem

Description

I use qemu-v7.0.0-28 docker/setup-qemu-action@v3 It can be built normally.
https://github.com/IabSDocker/gitlab-ce/actions/runs/12912622666/job/36007882511
image
But today, the image building failed (qemu-v9.2.0-51), because QEMU simulated arm64 and ran the libc-bin configuration script with a segmentation fault, which caused the dpkg configuration to fail, and then the apt get install failed.
https://github.com/IabSDocker/gitlab-ce/actions/runs/13290105251/job/37108482681
image
I'm not sure if this is a bug in qemu-v9.2.0-51. How should I handle this error.

Expected behaviour

I hope to solve the problem about "The segment error occurs when QEMU simulates arm64 to run the libc bin configuration script, which causes the dpkg configuration to fail"

Actual behaviour

I use qemu-v7.0.0-28 docker/setup-qemu-action@v3 It can be built normally.
https://github.com/IabSDocker/gitlab-ce/actions/runs/12912622666/job/36007882511
image
But today, the image building failed (qemu-v9.2.0-51), because QEMU simulated arm64 and ran the libc-bin configuration script with a segmentation fault, which caused the dpkg configuration to fail, and then the apt get install failed.
https://github.com/IabSDocker/gitlab-ce/actions/runs/13290105251/job/37108482681
image

Repository URL

No response

Workflow run URL

https://github.com/IabSDocker/gitlab-ce/actions/runs/13290105251/job/37108482681

YAML workflow

name: Build and Push Multi-Arch Image

on:
  push:
    tags:
      - "*"

jobs:
  docker:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v3
      
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3
      
      - name: Login to container registry
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.REGISTRY_USERNAME }}
          password: ${{ secrets.REGISTRY_TOKEN }}

      
      - name: Set variables
        shell: bash
        run: |
          echo "GITLAB_DIR=omnibus-gitlab" >> $GITHUB_ENV
          echo "DOCKER_DIR=omnibus-gitlab/docker" >> $GITHUB_ENV
          echo "GITLAB_REF_TAG=$(echo ${{ github.ref_name }} | sed 's/\-/\+/')" >> $GITHUB_ENV
          echo "DOCKER_NAMESPACE=iabsdocker/gitlab-ce" >> $GITHUB_ENV
          LATEST=$(git tag | sort -rV | head -n 1)
          if [ "${LATEST}" == "${{ github.ref_name }}" ]; then 
            echo "IS_LATEST=true">> $GITHUB_ENV
          else
            echo "IS_LATEST=false">> $GITHUB_ENV
          fi
      
      - name: Docker meta
        id: meta
        uses: docker/metadata-action@v5
        with:
          images: ${{ env.DOCKER_NAMESPACE }}
          tags: |
            type=match,pattern=(.*\..*)\..*-ce\..*,group=0
      
      - name: Check out https://github.com/gitlabhq/omnibus-gitlab.git
        uses: actions/checkout@v4
        with:
          repository: gitlabhq/omnibus-gitlab
          path: ${{ env.GITLAB_DIR }}
          ref: ${{ env.GITLAB_REF_TAG }}

      - name: Prepare for Multi-Arch building
        shell: bash
        run: |
          echo ". /etc/os-release" > ./${{ env.DOCKER_DIR }}/RELEASE
          echo "PACKAGECLOUD_REPO=gitlab-ce" >> ./${{ env.DOCKER_DIR }}/RELEASE
          echo "RELEASE_PACKAGE=gitlab-ce" >> ./${{ env.DOCKER_DIR }}/RELEASE
          echo "RELEASE_VERSION=${{ github.ref_name }}"  >> ./${{ env.DOCKER_DIR }}/RELEASE
          # 根据平台设置下载 URL
          sed -i 's/SHELL \[\"\/bin\/sh\", \"-c\"\],/SHELL \[\"\/bin\/sh\", \"-c\"\]/' ./${{ env.DOCKER_DIR }}/Dockerfile
          sed -i '/Install required packages/a RUN apt-get clean && dpkg --configure -a && apt-get update -q && apt-get install -y --fix-missing libatomic1' ./${{ env.DOCKER_DIR }}/Dockerfile
          echo 'ARCH=$(uname -m) && if [[ "${ARCH}" == "x86_64" ]]; then DOWNLOAD_URL="https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/${UBUNTU_CODENAME}/gitlab-ce_${{ github.ref_name }}_amd64.deb/download.deb"; elif [[ "${ARCH}" == "aarch64" ]]; then DOWNLOAD_URL="https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/${UBUNTU_CODENAME}/gitlab-ce_${{ github.ref_name }}_arm64.deb/download.deb"; else echo "Unknown architecture" && exit 1; fi' >> ./${{ env.DOCKER_DIR }}/RELEASE
          echo "DOWNLOAD_URL_amd64=https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/jammy/gitlab-ce_${{ github.ref_name }}_amd64.deb/download.deb" >> ./${{ env.DOCKER_DIR }}/RELEASE
          echo "DOWNLOAD_URL_arm64=https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/jammy/gitlab-ce_${{ github.ref_name }}_arm64.deb/download.deb" >> ./${{ env.DOCKER_DIR }}/RELEASE

          # 根据架构修改 setup
          sed -i '/Patch omnibus package/a [ "$(uname -m)" == "arm"* ] || [ "$(uname -m)" == "aarch64" ] && sed -i "s8# ignore-warnings ARM64-COW-BUG8ignore-warnings ARM64-COW-BUG8g" /opt/gitlab/embedded/cookbooks/redis/templates/default/redis.conf.erb' ./${{ env.DOCKER_DIR }}/assets/setup
          

      - name: Build and Push Multi-Arch Image
        uses: docker/build-push-action@v6
        with:
          context: ${{ env.DOCKER_DIR }}
          platforms: linux/amd64,linux/arm64
          push: true
          tags: ${{ steps.meta.outputs.tags }}

Workflow logs

No response

BuildKit logs


Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions