Skip to content
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

build for arm is failing when using docker buildx #1

Open
weidi opened this issue Jul 19, 2022 · 10 comments
Open

build for arm is failing when using docker buildx #1

weidi opened this issue Jul 19, 2022 · 10 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@weidi
Copy link
Collaborator

weidi commented Jul 19, 2022

When using docker buildx to build multiarch images the arm builds are failing to build blake2.
If building natively on arm (RaspberryPi) there is no issue so somethings funky with the way how buildx does ARM abstraction.

@weidi weidi added bug Something isn't working help wanted Extra attention is needed labels Jul 19, 2022
@chipitsine
Copy link
Member

please provide steps how to invoke buildx to build arm (is it really arm64 ?) images

@weidi
Copy link
Collaborator Author

weidi commented Jul 20, 2022

You can invoke buildx this way creating amd64, arm64 and armv7(rpi1-3) images

docker buildx build -t softethervpn/vpnserver:stable -f .\Dockerfile.stable --push --platform linux/amd64,linux/arm64,linux/arm/v7 .

@chipitsine
Copy link
Member

I tried on Docker version 20.10.12, build 20.10.12-0ubuntu2~20.04.1:

r$ docker buildx build -t softethervpn/vpnserver:stable -f Dockerfile.stable --push --platform linux/amd64,linux/arm64,linux/arm/v7 .
unknown shorthand flag: 't' in -t
See 'docker --help'.

...

@chipitsine
Copy link
Member

nevermind, I've figured out how to invoke it

@chipitsine
Copy link
Member

if I invoke like that docker build -f Dockerfile --platform linux/amd64 ., I see

Step 11/27 : FROM builder-$TARGETARCH AS builder
invalid reference format

@chipitsine
Copy link
Member

I picked build command from README ...

docker build -t softethevpn:latest .
Sending build context to Docker daemon  97.28kB
Step 1/27 : FROM alpine as base
 ---> d7d3d98c851f
Step 2/27 : ARG GIT_TAG=5.02.5180
 ---> Using cache
 ---> 1105e1a0e774
Step 3/27 : ARG TARGETPLATFORM
 ---> Using cache
 ---> b37b6da6ca22
Step 4/27 : ARG TARGETARCH
 ---> Using cache
 ---> 7688a88f9472
Step 5/27 : FROM base AS builder-amd64
 ---> 7688a88f9472
Step 6/27 : ENV TARGET_CONFIG_FLAGS ""
 ---> Using cache
 ---> 1975ce948d0d
Step 7/27 : FROM base AS builder-arm64
 ---> 7688a88f9472
Step 8/27 : ENV TARGET_CONFIG_FLAGS "--disable-sse2"
 ---> Using cache
 ---> ce734e35db7a
Step 9/27 : FROM base AS builder-arm
 ---> 7688a88f9472
Step 10/27 : ENV TARGET_CONFIG_FLAGS "--disable-sse2"
 ---> Using cache
 ---> ce734e35db7a
Step 11/27 : FROM builder-$TARGETARCH AS builder
invalid reference format

@weidi
Copy link
Collaborator Author

weidi commented Jul 24, 2022

Reverted the implementation of different Target config flags in 88972ae as this was just a try for a workaround.

@weidi
Copy link
Collaborator Author

weidi commented Sep 30, 2022

I implemented a GitHub CI to try on a completely different platform but it seems that the buildx (qemu) ARM emulation has some drawbacks here. Still not sure on how to work around it

@ohsawa
Copy link

ohsawa commented Oct 10, 2024

Although this issue is closed, I found that it might be caused by the cmake_host_system_information() function returning the "real" CPU information, even when running inside a QEMU environment. This can be found in the SoftEtherVPN source at src/Cedar/CMakeLists.txt (link below).

https://github.com/SoftEtherVPN/SoftEtherVPN/blob/e475d70c0b0e62683cf03e764d0937f54aa62266/src/Cedar/CMakeLists.txt#L24

It may be fixed by using a different method, such as check_cxx_compiler_flag().

@chipitsine
Copy link
Member

we love pull requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants