386 appears as X86_64
a16bitsysop opened this issue · comments
Behaviour
Building a multi arch image with buildx the 386 build cannot tell it is 386
Steps to reproduce this issue
- Use Qemu action
- Use Setup buildx action
- Use buildx action with linux/386 platform
Expected behaviour
Build thinks it is running on 386
Tell us what should happen
Actual behaviour
Tell us what happens instead
#12 [linux/386 2/2] RUN cat /proc/cpuinfo && uname -mp && uname -a && arch &...
#12 1.191 processor : 0
#12 1.191 vendor_id : GenuineIntel
#12 1.191 cpu family : 6
#12 1.191 model : 85
#12 1.191 model name : Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
#12 1.191 stepping : 4
#12 1.191 microcode : 0xffffffff
#12 1.191 cpu MHz : 2095.246
#12 1.191 cache size : 36608 KB
#12 1.191 physical id : 0
#12 1.191 siblings : 2
#12 1.191 core id : 0
#12 1.191 cpu cores : 2
#12 1.191 apicid : 0
#12 1.191 initial apicid : 0
#12 1.191 fpu : yes
#12 1.191 fpu_exception : yes
#12 1.191 cpuid level : 21
#12 1.191 wp : yes
#12 1.191 flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xsaves md_clear
#12 1.191 bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit
#12 1.191 bogomips : 4190.49
#12 1.191 clflush size : 64
#12 1.191 cache_alignment : 64
#12 1.191 address sizes : 46 bits physical, 48 bits virtual
#12 1.191 power management:
#12 1.191
#12 1.191 processor : 1
#12 1.191 vendor_id : GenuineIntel
#12 1.191 cpu family : 6
#12 1.191 model : 85
#12 1.191 model name : Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
#12 1.191 stepping : 4
#12 1.191 microcode : 0xffffffff
#12 1.191 cpu MHz : 2095.246
#12 1.191 cache size : 36608 KB
#12 1.191 physical id : 0
#12 1.191 siblings : 2
#12 1.191 core id : 1
#12 1.191 cpu cores : 2
#12 1.191 apicid : 1
#12 1.191 initial apicid : 1
#12 1.191 fpu : yes
#12 1.191 fpu_exception : yes
#12 1.191 cpuid level : 21
#12 1.191 wp : yes
#12 1.191 flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xsaves md_clear
#12 1.191 bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit
#12 1.191 bogomips : 4190.49
#12 1.191 clflush size : 64
#12 1.191 cache_alignment : 64
#12 1.191 address sizes : 46 bits physical, 48 bits virtual
#12 1.191 power management:
#12 1.191
#12 1.195 x86_64 unknown
#12 1.197 Linux buildkitsandbox 5.4.0-1031-azure #32~18.04.1-Ubuntu SMP Tue Oct 6 10:03:22 UTC 2020 x86_64 Linux
#12 1.199 x86_64
From Dockerfile
FROM alpine:3.12
# hadolint ignore=DL3018
RUN cat /proc/cpuinfo \
&& uname -mp \
&& uname -a \
&& arch \
&& apk add --no-cache python3
CMD [ "echo", "Hello Workd!!!" ]
Configuration
-
Repository URL (if public):
https://github.com/a16bitsysop/actions-test/tree/docker-build -
Build URL (if public):
https://github.com/a16bitsysop/actions-test/actions/runs/319856970
yml
paste your YAML workflow file here and remove sensitive data
name: Docker-Build-Push
# Run this workflow every time a new commit pushed to docker-build branch
on:
push:
branches:
- docker-build
jobs:
# Set the job key. The key is displayed as the job name
# when a job name is not provided
super-lint:
# Name the Job
name: Lint code base
# Set the type of machine to run on
runs-on: ubuntu-latest
steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'true'
# Runs the Super-Linter action
- name: Run Super-Linter
uses: github/super-linter@v3
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-test:
name: Build test image and test
runs-on: ubuntu-latest
needs: super-lint
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: latest
-
name: Build Test Image
run: |
export DOCKER_CONTENT_TRUST=1
docker buildx build -t testimage --load .
-
name: Scan Test Iamge
uses: Azure/container-scan@v0
with:
image-name: testimage
buildx:
name: Build and push
runs-on: ubuntu-latest
needs: build-test
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
-
name: Setup Path
run: |
echo "${GITHUB_WORKSPACE}"/travis-helpers >> $GITHUB_PATH
echo ${HOME}/.local/bin >> $GITHUB_PATH
-
name: Install helper dependencies
run: |
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install --upgrade docker natsort bs4
-
name: Get Label Info
id: docklabel
run: |
INFO=README.md
if [ -f "$INFO" ]; then
echo "Reading $INFO..."
NAME="$(head -1 README.md| cut -d' ' -f2)"
DESC="$(head -2 README.md | tail -n1)"
else
echo "$INFO not found"
DESC="None"
fi
[ $EDGE == "yes" ] && _e="-e"
APK_VER="$(version.py $_e -a $APK)"
ALP_VER="$(version.py -b)"
echo "$ALP_VER, $APK is $APK_VER"
echo "name: $NAME"
echo "desc: $DESC"
echo "::set-output name=apk_ver::$APK_VER"
echo "::set-output name=alp_ver::$ALP_VER"
echo "::set-output name=ver::$APK_VER-alpine$ALP_VER"
echo "::set-output name=name-label::$NAME"
echo "::set-output name=desc::$DESC"
echo "::set-output name=plats::$PLATS"
echo "::set-output name=img::$IMAGE_NAME"
echo "::set-output name=date::$(date -u +'%Y-%m-%d %H:%M:%S')"
echo "::set-output name=sha::$GITHUB_SHA"
echo "::set-output name=repo::$GITHUB_REPOSITORY"
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: ${{ steps.docklabel.outputs.plats }}
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: latest
-
name: Available Platforms
run: echo ${{ steps.buildx.outputs.platforms }}
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Show Labels
run: |
echo "Alpine Ver: ${{ steps.docklabel.outputs.alp_ver }}"
echo "Main Apk: $APK"
echo "Apk Ver: ${{ steps.docklabel.outputs.apk_ver }}"
echo "Tag Ver: ${{ steps.docklabel.outputs.ver }}"
echo "Name: ${{ steps.docklabel.outputs.name-label }}"
echo "Desc: ${{ steps.docklabel.outputs.desc }}"
echo "Platforms: ${{ steps.docklabel.outputs.plats }}"
echo "Image Name: ${{ steps.docklabel.outputs.img }}"
echo "Date: ${{ steps.docklabel.outputs.date }}"
echo "Sha: ${{ steps.docklabel.outputs.sha }}"
echo "Repo: ${{ steps.docklabel.outputs.repo }}"
-
name: Build
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: ${{ steps.docklabel.outputs.plats }}
push: true
tags: |
${{ steps.docklabel.outputs.img }}:${{ steps.docklabel.outputs.ver }}
${{ steps.docklabel.outputs.img }}
labels: |
org.label-schema.schema-version=1.0
org.label-schema.build-date=${{ steps.docklabel.outputs.date }}
org.label-schema.version=${{ steps.docklabel.outputs.ver }}
org.label-schema.vcs-ref=${{ steps.docklabel.outputs.sha }}
org.label-schema.vcs-url=https://github.com/${{ steps.docklabel.outputs.repo }}
org.label-schema.name=${{ steps.docklabel.outputs.name-label }}
org.label-schema.version=${{ steps.docklabel.outputs.apk_ver }}
org.label-schema.description=${{ steps.docklabel.outputs.desc }}
alpine-version=${{ steps.docklabel.outputs.alp_ver }}
-
name: Update Microbadger Badges
run: |
if [ -z ${{ secrets.WEBHOOK }} ]; then
echo "\$WEBHOOK not set"
else
echo "Triggering Microbadger \$WEBHOOK"
curl -X POST "https://hooks.microbadger.com/images/$IMAGE_NAME/${{ secrets.WEBHOOK }}"
fi
env:
PLATS: linux/386,linux/amd64,linux/ppc64le,linux/s390x,linux/arm/v7,linux/arm64
IMAGE_NAME: a16bitsysop/actions-test
APK: postfix
# yes to get edge version of APK
EDGE: no
# in github secrets for repo
# DOCKER_USERNANE
# DOCKER_PASSWORD
# WEBHOOK
### Logs
> Download the [log file of your build](https://help.github.com/en/actions/configuring-and-managing-workflows/managing-a-workflow-run#downloading-logs) and [attach it](https://help.github.com/en/github/managing-your-work-on-github/file-attachments-on-issues-and-pull-requests) to this issue.
[logs_92.zip](https://github.com/docker/setup-qemu-action/files/5416222/logs_92.zip)
@a16bitsysop i386
is not emulated. For 32-bit container image, the result of uname
can be the 64-bit's one but it's a 32-bit environment.
Okay thanks for the info, if it is 32bit can rename output from compilation in another image