SoftEtherVPN / SoftetherVPN-docker

49 stars 17 forks source link

build for arm is failing when using docker buildx #1

Open weidi opened 2 years ago

weidi commented 2 years ago

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.

chipitsine commented 2 years ago

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

weidi commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

nevermind, I've figured out how to invoke it

chipitsine commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

weidi commented 1 year ago

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