Place1 / wg-access-server

An all-in-one WireGuard VPN solution with a web ui for connecting devices
MIT License
1.78k stars 222 forks source link

Support for ARM devices #65

Closed matjaz321 closed 3 years ago

matjaz321 commented 4 years ago

Hey, Docker image is not supported on ARM based devices. Are you planning to support those devices?

Place1 commented 4 years ago

Yeah I’d like to, especially for raspberry pi users. I’d be happy to accept a pr for this.

On Wed, 5 Aug 2020 at 2:19 am, Matjaz Zavski notifications@github.com wrote:

Hey, Docker image is not supported on ARM based devices. Are you planning to support those devices?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Place1/wg-access-server/issues/65, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZQDFVAHYHY7KYO6XNYDLLR7AYKJANCNFSM4PUSIHNA .

veverkap commented 4 years ago

I was able to build the Dockerfile on my Pi 4 without issue.


Sending build context to Docker daemon  1.583MB
Step 1/39 : FROM node:10 as website
10: Pulling from library/node
323178d00ec2: Pull complete
a7b4e15a7945: Pull complete
caf9cb1ef704: Pull complete
a3ae4cf51f1a: Pull complete
883525c9d83b: Pull complete
b1907e1a1a78: Pull complete
0d30f91f17b7: Pull complete
97ad8bc43c22: Pull complete
3049a26ff4a1: Pull complete
Digest: sha256:02a5fd0329277d081e65ccb5964a82dd5d735c2a8a92f089656486b32c29da49
Status: Downloaded newer image for node:10
 ---> f58e4c77eca6
Step 2/39 : RUN apt-get update
 ---> Running in 5b25d878f6f8
Get:1 http://security.debian.org/debian-security stretch/updates InRelease [53.0 kB]
Ign:2 http://deb.debian.org/debian stretch InRelease
Get:3 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB]
Get:4 http://deb.debian.org/debian stretch Release [118 kB]
Get:5 http://deb.debian.org/debian stretch Release.gpg [2410 B]
Get:6 http://security.debian.org/debian-security stretch/updates/main armhf Packages [521 kB]
Get:7 http://deb.debian.org/debian stretch-updates/main armhf Packages [2576 B]
Get:8 http://deb.debian.org/debian stretch/main armhf Packages [6908 kB]
Fetched 7699 kB in 14s (528 kB/s)
Reading package lists...
Removing intermediate container 5b25d878f6f8
 ---> c81698a13321
Step 3/39 : RUN apt-get install -y protobuf-compiler libprotobuf-dev
 ---> Running in 0693fcd0aa9c
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  libprotobuf-lite10 libprotobuf10 libprotoc10
The following NEW packages will be installed:
  libprotobuf-dev libprotobuf-lite10 libprotobuf10 libprotoc10
  protobuf-compiler
0 upgraded, 5 newly installed, 0 to remove and 2 not upgraded.
Need to get 2264 kB of archives.
After this operation, 10.5 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian stretch/main armhf libprotobuf10 armhf 3.0.0-9 [605 kB]
Get:2 http://deb.debian.org/debian stretch/main armhf libprotobuf-lite10 armhf 3.0.0-9 [116 kB]
Get:3 http://deb.debian.org/debian stretch/main armhf libprotobuf-dev armhf 3.0.0-9 [955 kB]
Get:4 http://deb.debian.org/debian stretch/main armhf libprotoc10 armhf 3.0.0-9 [536 kB]
Get:5 http://deb.debian.org/debian stretch/main armhf protobuf-compiler armhf 3.0.0-9 [52.4 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 2264 kB in 15s (145 kB/s)
Selecting previously unselected package libprotobuf10:armhf.
(Reading database ... 29675 files and directories currently installed.)
Preparing to unpack .../libprotobuf10_3.0.0-9_armhf.deb ...
Unpacking libprotobuf10:armhf (3.0.0-9) ...
Selecting previously unselected package libprotobuf-lite10:armhf.
Preparing to unpack .../libprotobuf-lite10_3.0.0-9_armhf.deb ...
Unpacking libprotobuf-lite10:armhf (3.0.0-9) ...
Selecting previously unselected package libprotobuf-dev:armhf.
Preparing to unpack .../libprotobuf-dev_3.0.0-9_armhf.deb ...
Unpacking libprotobuf-dev:armhf (3.0.0-9) ...
Selecting previously unselected package libprotoc10:armhf.
Preparing to unpack .../libprotoc10_3.0.0-9_armhf.deb ...
Unpacking libprotoc10:armhf (3.0.0-9) ...
Selecting previously unselected package protobuf-compiler.
Preparing to unpack .../protobuf-compiler_3.0.0-9_armhf.deb ...
Unpacking protobuf-compiler (3.0.0-9) ...
Setting up libprotobuf10:armhf (3.0.0-9) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Setting up libprotobuf-lite10:armhf (3.0.0-9) ...
Setting up libprotoc10:armhf (3.0.0-9) ...
Setting up protobuf-compiler (3.0.0-9) ...
Setting up libprotobuf-dev:armhf (3.0.0-9) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Removing intermediate container 0693fcd0aa9c
 ---> 192b65898ecc
Step 4/39 : WORKDIR /code
 ---> Running in f235b18ef005
Removing intermediate container f235b18ef005
 ---> d415a5627fca
Step 5/39 : COPY ./website/package.json ./
 ---> 7ed5e5b077bb
Step 6/39 : COPY ./website/package-lock.json ./
 ---> 9f74bc6d2cda
Step 7/39 : RUN npm ci --no-audit --prefer-offline
 ---> Running in 6d3a58f82c3f

> core-js@2.6.11 postinstall /code/node_modules/babel-runtime/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> fsevents@1.2.13 install /code/node_modules/webpack-dev-server/node_modules/fsevents
> node install.js

Skipping 'fsevents' build as platform linux is not supported

> fsevents@1.2.13 install /code/node_modules/watchpack-chokidar2/node_modules/fsevents
> node install.js

Skipping 'fsevents' build as platform linux is not supported

> core-js@3.6.5 postinstall /code/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> fsevents@1.2.13 install /code/node_modules/jest-haste-map/node_modules/fsevents
> node install.js

Skipping 'fsevents' build as platform linux is not supported

> core-js-pure@3.6.5 postinstall /code/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

added 1678 packages in 168.59s
Removing intermediate container 6d3a58f82c3f
 ---> 79ed8cf3c56e
Step 8/39 : COPY ./proto/ ../proto/
 ---> 6b8cf17d9227
Step 9/39 : COPY ./website/ ./
 ---> 254f62f8ddd0
Step 10/39 : RUN npm run codegen
 ---> Running in 5df1da56f8ad

> @ codegen /code
> grpc-ts-web -o src/sdk ../proto/*.proto

executing: protoc --grpc-ts-web_out src/sdk --plugin=protoc-gen-grpc-ts-web=/code/node_modules/grpc-ts-web/bin/protoc-gen-grpc-ts-web-linux-amd64 --proto_path=../proto ../proto/devices.proto ../proto/server.proto
/code/node_modules/grpc-ts-web/bin/protoc-gen-grpc-ts-web-linux-amd64: program not found or is not executable
--grpc-ts-web_out: protoc-gen-grpc-ts-web: Plugin failed with status code 1.
Removing intermediate container 5df1da56f8ad
 ---> 44c2c95d8c85
Step 11/39 : RUN npm run build
 ---> Running in fbb734dd15dd

> @ build /code
> react-scripts build

Creating an optimized production build...
Compiled successfully.

File sizes after gzip:

  211.68 KB  build/static/js/2.80acb064.chunk.js
  12.47 KB   build/static/js/main.60cf8276.chunk.js
  770 B      build/static/js/runtime-main.cf8c75f0.js
  272 B      build/static/css/main.354eeed7.chunk.css

The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.
You may serve it with a static server:

  npm install -g serve
  serve -s build

Find out more about deployment here:

  bit.ly/CRA-deploy

Removing intermediate container fbb734dd15dd
 ---> 76179c17075e
Step 12/39 : FROM golang:1.13.8 as server
1.13.8: Pulling from library/golang
3182cf45068c: Pull complete
1b727ab99a6a: Pull complete
eab9435f7cf0: Pull complete
4f2ad791c843: Pull complete
1a879613e63b: Pull complete
ea436256305c: Pull complete
c8235e2331ce: Pull complete
Digest: sha256:d7e0b99badf7f34b5096089484a733897c9b89aa12ffb9f67f81da054f8a403e
Status: Downloaded newer image for golang:1.13.8
 ---> c89504c6e875
Step 13/39 : RUN apt-get update
 ---> Running in 8303bf47f11a
Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:2 http://deb.debian.org/debian buster InRelease [122 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Get:4 http://security.debian.org/debian-security buster/updates/main armhf Packages [212 kB]
Get:5 http://deb.debian.org/debian buster/main armhf Packages [7698 kB]
Get:6 http://deb.debian.org/debian buster-updates/main armhf Packages [7848 B]
Fetched 8158 kB in 14s (564 kB/s)
Reading package lists...
Removing intermediate container 8303bf47f11a
 ---> 4112ebd90bf5
Step 14/39 : RUN apt-get install -y protobuf-compiler libprotobuf-dev
 ---> Running in c5a2896f11d2
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  libprotobuf-lite17 libprotobuf17 libprotoc17 zlib1g-dev
The following NEW packages will be installed:
  libprotobuf-dev libprotobuf-lite17 libprotobuf17 libprotoc17
  protobuf-compiler zlib1g-dev
0 upgraded, 6 newly installed, 0 to remove and 20 not upgraded.
Need to get 2749 kB of archives.
After this operation, 12.5 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main armhf zlib1g-dev armhf 1:1.2.11.dfsg-1 [207 kB]
Get:2 http://deb.debian.org/debian buster/main armhf libprotobuf17 armhf 3.6.1.3-2 [688 kB]
Get:3 http://deb.debian.org/debian buster/main armhf libprotobuf-lite17 armhf 3.6.1.3-2 [149 kB]
Get:4 http://deb.debian.org/debian buster/main armhf libprotobuf-dev armhf 3.6.1.3-2 [1069 kB]
Get:5 http://deb.debian.org/debian buster/main armhf libprotoc17 armhf 3.6.1.3-2 [570 kB]
Get:6 http://deb.debian.org/debian buster/main armhf protobuf-compiler armhf 3.6.1.3-2 [64.2 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 2749 kB in 11s (259 kB/s)
Selecting previously unselected package zlib1g-dev:armhf.
(Reading database ... 15140 files and directories currently installed.)
Preparing to unpack .../0-zlib1g-dev_1%3a1.2.11.dfsg-1_armhf.deb ...
Unpacking zlib1g-dev:armhf (1:1.2.11.dfsg-1) ...
Selecting previously unselected package libprotobuf17:armhf.
Preparing to unpack .../1-libprotobuf17_3.6.1.3-2_armhf.deb ...
Unpacking libprotobuf17:armhf (3.6.1.3-2) ...
Selecting previously unselected package libprotobuf-lite17:armhf.
Preparing to unpack .../2-libprotobuf-lite17_3.6.1.3-2_armhf.deb ...
Unpacking libprotobuf-lite17:armhf (3.6.1.3-2) ...
Selecting previously unselected package libprotobuf-dev:armhf.
Preparing to unpack .../3-libprotobuf-dev_3.6.1.3-2_armhf.deb ...
Unpacking libprotobuf-dev:armhf (3.6.1.3-2) ...
Selecting previously unselected package libprotoc17:armhf.
Preparing to unpack .../4-libprotoc17_3.6.1.3-2_armhf.deb ...
Unpacking libprotoc17:armhf (3.6.1.3-2) ...
Selecting previously unselected package protobuf-compiler.
Preparing to unpack .../5-protobuf-compiler_3.6.1.3-2_armhf.deb ...
Unpacking protobuf-compiler (3.6.1.3-2) ...
Setting up libprotobuf-lite17:armhf (3.6.1.3-2) ...
Setting up zlib1g-dev:armhf (1:1.2.11.dfsg-1) ...
Setting up libprotobuf17:armhf (3.6.1.3-2) ...
Setting up libprotoc17:armhf (3.6.1.3-2) ...
Setting up protobuf-compiler (3.6.1.3-2) ...
Setting up libprotobuf-dev:armhf (3.6.1.3-2) ...
Processing triggers for libc-bin (2.28-10) ...
Removing intermediate container c5a2896f11d2
 ---> 20d70b69efab
Step 15/39 : WORKDIR /code
 ---> Running in 2907de28c9cf
Removing intermediate container 2907de28c9cf
 ---> ebdb0e9decac
Step 16/39 : ENV GOOS=linux
 ---> Running in 8e9fdd38dadc
Removing intermediate container 8e9fdd38dadc
 ---> 9204f6019396
Step 17/39 : ENV GARCH=amd64
 ---> Running in bafc2752e0f5
Removing intermediate container bafc2752e0f5
 ---> c7521852ced1
Step 18/39 : ENV CGO_ENABLED=0
 ---> Running in 3cfa53e1a4f5
Removing intermediate container 3cfa53e1a4f5
 ---> 837b42be5af7
Step 19/39 : ENV GO111MODULE=on
 ---> Running in ebf1b8f17baf
Removing intermediate container ebf1b8f17baf
 ---> 85ac84c927bf
Step 20/39 : RUN go get github.com/golang/protobuf/protoc-gen-go@v1.3.5
 ---> Running in 44278b539386
go: finding github.com/golang/protobuf v1.3.5
go: finding github.com/golang/protobuf/protoc-gen-go v1.3.5
go: finding github.com/golang v1.3.5
go: finding github.com v1.3.5
go: downloading github.com/golang/protobuf v1.3.5
go: extracting github.com/golang/protobuf v1.3.5
Removing intermediate container 44278b539386
 ---> 59083e45c961
Step 21/39 : COPY ./go.mod ./
 ---> 52c99f2ae59f
Step 22/39 : COPY ./go.sum ./
 ---> f2014e2edebd
Step 23/39 : RUN go mod download
 ---> Running in 99fc3147948b
go: finding cloud.google.com/go v0.34.0
go: finding github.com/BurntSushi/toml v0.3.1
go: finding github.com/PuerkitoBio/goquery v1.5.1
go: finding github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
go: finding github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d
go: finding github.com/andybalholm/cascadia v1.1.0
go: finding github.com/census-instrumentation/opencensus-proto v0.2.1
go: finding github.com/client9/misspell v0.3.4
go: finding github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f
go: finding github.com/coreos/go-iptables v0.4.5
go: finding github.com/coreos/go-oidc v2.2.1+incompatible
go: finding github.com/davecgh/go-spew v1.1.1
go: finding github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd
go: finding github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f
go: finding github.com/docker/docker v1.13.1
go: finding github.com/docker/libnetwork v0.8.0-dev.2.0.20200217033114-6659f7f4d8c1
go: finding github.com/envoyproxy/go-control-plane v0.9.4
go: finding github.com/envoyproxy/protoc-gen-validate v0.1.0
go: finding github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5
go: finding github.com/go-kit/kit v0.9.0
go: finding github.com/go-logfmt/logfmt v0.4.0
go: finding github.com/go-sql-driver/mysql v1.5.0
go: finding github.com/go-stack/stack v1.8.0
go: finding github.com/gogo/protobuf v1.2.1
go: finding github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe
go: finding github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
go: finding github.com/golang/mock v1.1.1
go: finding github.com/golang/protobuf v1.4.2
go: finding github.com/google/go-cmp v0.5.0
go: finding github.com/google/uuid v1.1.1
go: finding github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1
go: finding github.com/gorilla/handlers v1.4.2
go: finding github.com/gorilla/mux v1.7.4
go: finding github.com/gorilla/securecookie v1.1.1
go: finding github.com/gorilla/sessions v1.2.0
go: finding github.com/gorilla/websocket v1.4.2
go: finding github.com/grpc-ecosystem/go-grpc-middleware v1.2.0
go: finding github.com/improbable-eng/grpc-web v0.13.0
go: finding github.com/ishidawataru/sctp v0.0.0-20191218070446-00ab2ac2db07
go: finding github.com/jinzhu/gorm v1.9.14
go: finding github.com/jinzhu/inflection v1.0.0
go: finding github.com/jinzhu/now v1.0.1
go: finding github.com/jsimonetti/rtnetlink v0.0.0-20200117123717-f846d4f6c1f4
go: finding github.com/jtolds/gls v4.20.0+incompatible
go: finding github.com/kisielk/errcheck v1.1.0
go: finding github.com/kisielk/gotool v1.0.0
go: finding github.com/konsorten/go-windows-terminal-sequences v1.0.3
go: finding github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515
go: finding github.com/kr/pretty v0.1.0
go: finding github.com/kr/pty v1.1.1
go: finding github.com/kr/text v0.1.0
go: finding github.com/lib/pq v1.7.0
go: finding github.com/mattn/go-sqlite3 v2.0.3+incompatible
go: finding github.com/mdlayher/genetlink v1.0.0
go: finding github.com/mdlayher/netlink v1.1.0
go: finding github.com/miekg/dns v1.1.30
go: finding github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721
go: finding github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223
go: finding github.com/opentracing/opentracing-go v1.1.0
go: finding github.com/patrickmn/go-cache v2.1.0+incompatible
go: finding github.com/pkg/errors v0.9.1
go: finding github.com/place1/wg-embed v0.2.0
go: finding github.com/pmezard/go-difflib v1.0.0
go: finding github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35
go: finding github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4
go: finding github.com/rs/cors v1.7.0
go: finding github.com/sirupsen/logrus v1.6.0
go: finding github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d
go: finding github.com/smartystreets/goconvey v1.6.4
go: finding github.com/stretchr/objx v0.1.1
go: finding github.com/stretchr/testify v1.4.0
go: finding github.com/tg123/go-htpasswd v1.0.0
go: finding github.com/vishvananda/netlink v1.1.0
go: finding github.com/vishvananda/netns v0.0.0-20200520041808-52d707b772fe
go: finding go.uber.org/atomic v1.4.0
go: finding go.uber.org/multierr v1.1.0
go: finding go.uber.org/zap v1.10.0
go: finding golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899
go: finding golang.org/x/exp v0.0.0-20190121172915-509febef88a4
go: finding golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3
go: finding golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee
go: finding golang.org/x/net v0.0.0-20200707034311-ab3426394381
go: finding golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
go: finding golang.org/x/sync v0.0.0-20190423024810-112230192c58
go: finding golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae
go: finding golang.org/x/text v0.3.3
go: finding golang.org/x/tools v0.0.0-20191216052735-49a3e744a425
go: finding golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
go: finding golang.zx2c4.com/wireguard v0.0.20200320
go: finding golang.zx2c4.com/wireguard/wgctrl v0.0.0-20200609130330-bd2cb7843e1b
go: finding google.golang.org/appengine v1.6.6
go: finding google.golang.org/genproto v0.0.0-20200715011427-11fb19a81f2c
go: finding google.golang.org/grpc v1.30.0
go: finding google.golang.org/protobuf v1.25.0
go: finding gopkg.in/Knetic/govaluate.v2 v2.3.0
go: finding gopkg.in/alecthomas/kingpin.v2 v2.2.6
go: finding gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
go: finding gopkg.in/ini.v1 v1.57.0
go: finding gopkg.in/square/go-jose.v2 v2.5.1
go: finding gopkg.in/yaml.v2 v2.3.0
go: finding gotest.tools v2.2.0+incompatible
go: finding honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc
Removing intermediate container 99fc3147948b
 ---> 225483d91c7d
Step 24/39 : COPY ./proto/ ./proto/
 ---> 8c9543041c92
Step 25/39 : COPY ./codegen.sh ./
 ---> 5791a95fc2a6
Step 26/39 : RUN ./codegen.sh
 ---> Running in b5605cf0882d
Removing intermediate container b5605cf0882d
 ---> 20f597ca3d4b
Step 27/39 : COPY ./main.go ./main.go
 ---> b606d07f7b92
Step 28/39 : COPY ./internal/ ./internal/
 ---> b47c0b169ebe
Step 29/39 : COPY ./pkg/ ./pkg/
 ---> 606d93895596
Step 30/39 : RUN go build -o server
 ---> Running in 7492edfcc329
Removing intermediate container 7492edfcc329
 ---> d8f8bc633a64
Step 31/39 : FROM alpine:3.10
3.10: Pulling from library/alpine
ad20c9452290: Pull complete
Digest: sha256:f0e9534a598e501320957059cb2a23774b4d4072e37c7b2cf7e95b241f019e35
Status: Downloaded newer image for alpine:3.10
 ---> 97fdd8310375
Step 32/39 : RUN apk add iptables
 ---> Running in af4269272235
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/armv7/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/armv7/APKINDEX.tar.gz
(1/3) Installing libmnl (1.0.4-r0)
(2/3) Installing libnftnl-libs (1.1.3-r0)
(3/3) Installing iptables (1.8.3-r1)
Executing busybox-1.30.1-r3.trigger
OK: 5 MiB in 17 packages
Removing intermediate container af4269272235
 ---> db64dbe3019e
Step 33/39 : RUN apk add wireguard-tools
 ---> Running in 67798593f648
(1/9) Installing wireguard-tools-wg (0.0.20190601-r1)
(2/9) Installing iproute2 (4.20.0-r2)
Executing iproute2-4.20.0-r2.post-install
(3/9) Installing ncurses-terminfo-base (6.1_p20190518-r2)
(4/9) Installing ncurses-libs (6.1_p20190518-r2)
(5/9) Installing readline (8.0.0-r0)
(6/9) Installing bash (5.0.0-r0)
Executing bash-5.0.0-r0.post-install
(7/9) Installing openresolv (3.9.2-r0)
(8/9) Installing wireguard-tools-wg-quick (0.0.20190601-r1)
(9/9) Installing wireguard-tools (0.0.20190601-r1)
Executing busybox-1.30.1-r3.trigger
OK: 8 MiB in 26 packages
Removing intermediate container 67798593f648
 ---> 33bffd6779f4
Step 34/39 : RUN apk add curl
 ---> Running in c547475e17f3
(1/4) Installing ca-certificates (20191127-r2)
(2/4) Installing nghttp2-libs (1.39.2-r1)
(3/4) Installing libcurl (7.66.0-r0)
(4/4) Installing curl (7.66.0-r0)
Executing busybox-1.30.1-r3.trigger
Executing ca-certificates-20191127-r2.trigger
OK: 9 MiB in 30 packages
Removing intermediate container c547475e17f3
 ---> 39c73b510793
Step 35/39 : ENV CONFIG="/config.yaml"
 ---> Running in 71bcc25ba9c5
Removing intermediate container 71bcc25ba9c5
 ---> 0452b9335261
Step 36/39 : ENV STORAGE="file:///data"
 ---> Running in cf0adb2595be
Removing intermediate container cf0adb2595be
 ---> afe044a29914
Step 37/39 : COPY --from=server /code/server /server
 ---> 38ed5c9dce4e
Step 38/39 : COPY --from=website /code/build /website/build
 ---> 5ba7ff6fe7b9
Step 39/39 : CMD /server
 ---> Running in 74999a1dc5cb
Removing intermediate container 74999a1dc5cb
 ---> 9be0305159f9
Successfully built 9be0305159f9```
SirTerrific commented 4 years ago
executing: protoc --grpc-ts-web_out src/sdk --plugin=protoc-gen-grpc-ts-web=/code/node_modules/grpc-ts-web/bin/protoc-gen-grpc-ts-web-linux-amd64 --proto_path=../proto ../proto/devices.proto ../proto/server.proto
/code/node_modules/grpc-ts-web/bin/protoc-gen-grpc-ts-web-linux-amd64: program not found or is not executable
--grpc-ts-web_out: protoc-gen-grpc-ts-web: Plugin failed with status code 1.

You have an error executing: protoc --grpc-ts-web_out src/sdk --plugin=protoc-gen-grpc-ts-web=/code/node_modules/grpc-ts-web/bin/protoc-gen-grpc-ts-web-linux-amd64 --proto_path=../proto ../proto/devices.proto ../proto/server.proto /code/node_modules/grpc-ts-web/bin/protoc-gen-grpc-ts-web-linux-amd64: program not found or is not executable --grpc-ts-web_out: protoc-gen-grpc-ts-web: Plugin failed with status code 1.

I try to build an image for my PI but I changed the base image values. I'll paste the result there. Thanks.

SirTerrific commented 4 years ago

HI, So I tested with a few changes in the Dockerfile. I used the arm32v7 images. I have a raspberry PI 4 2Go with the 32bits OS. I have the same error

 executing: protoc --grpc-ts-web_out src/sdk --plugin=protoc-gen-grpc-ts-web=/code/node_modules/grpc-ts-web/bin/protoc-gen-grpc-ts-web-linux-amd64 --proto_path=../proto ../proto/devices.proto ../proto/server.proto
/code/node_modules/grpc-ts-web/bin/protoc-gen-grpc-ts-web-linux-amd64: program not found or is not executable
--grpc-ts-web_out: protoc-gen-grpc-ts-web: Plugin failed with status code 1.

Also, I suggest you to reduce some layer with your RUN : RUN apt-get update && apt-get install -y protobuf-compiler libprotobuf-dev && apt-get clean instead ofRUN apt-get update RUN apt-get install. And in the end an apt-get clean

And the same for the alpine one with a --no-cache RUN apk update && apk add --no-cache iptables wireguard-tools curl

### Build stage for the website frontend
FROM arm32v7/node:10 as website
RUN apt-get update && apt-get install -y protobuf-compiler libprotobuf-dev && apt-get clean
WORKDIR /code
COPY ./website/package.json ./
COPY ./website/package-lock.json ./
RUN npm ci --no-audit --prefer-offline
COPY ./proto/ ../proto/
COPY ./website/ ./
RUN npm run codegen
RUN npm run build

### Build stage for the website backend server
FROM arm32v7/golang as server
RUN apt-get update && apt-get install -y protobuf-compiler libprotobuf-dev && apt-get clean
WORKDIR /code
ENV GOOS=linux
ENV GOARCH=arm
ENV CGO_ENABLED=0
ENV GO111MODULE=on
RUN go get github.com/golang/protobuf/protoc-gen-go@v1.3.5
COPY ./go.mod ./
COPY ./go.sum ./
RUN go mod download
COPY ./proto/ ./proto/
COPY ./codegen.sh ./
RUN ./codegen.sh
COPY ./main.go ./main.go
COPY ./internal/ ./internal/
COPY ./pkg/ ./pkg/
RUN go build -o server

### Server
FROM arm32v7/alpine
RUN apk update && apk add --no-cache iptables wireguard-tools curl
ENV CONFIG="/config.yaml"
ENV STORAGE="file:///data"
COPY --from=server /code/server /server
COPY --from=website /code/build /website/build
CMD /server

I can start the docker without issue in the web interface and the VPN.

miberecz commented 4 years ago

I can see in the development section, one could build for himself a binary of this. Would you care to share how do I build one for myself on Raspberry?

timtorChen commented 4 years ago

Hi, @mqmq0 if you like to try building your own arm64 docker image on your amd64 pc, you can check the docker buildx feature, and this great blog. I am able to successfully build the images for amd64, arm64, and arm/v7 on docker hub.

Here is the simple instruction:

1. Install qemu-user-static

# debian based
sudo apt-get install -y qemu-user-static
# fedora or centOS
sudo dnf install -y qemu-user-static

2. Enable the buildx feature

export DOCKER_CLI_EXPERIMENTAL=enabled

3. Login to docker hub

# Because we are not able to directly load the multi-arch images built in the next step. 
# The strategy is we push the multi-arch images to docker hub and pull back the specific
# image for local run.
docker login

4. Start multi-arch build

# Specific three platforms: amd64 (Most of your laptops and servers), arm64 (Pi3 and Pi4), and arm/v7 (Pi2)
PLATFORM=linux/amd64,linux/arm64,linux/arm/v7
# create a instance called "builder" with specific plaforms
docker buildx create --name builder --platform="$PLATFORM"
# build and push multi-arch images, dont forget changing to your username
docker buildx build --platform="$PLATFORM" -t username/wg-access-server:edge . --push
timtorChen commented 4 years ago

I find there is a publish.py script for your build and publish workflow. Maybe you can simply enable the feature by change docker build ... to docker buildx buildx ... --push. If you are interested in github action auto build , I am pleased to make a PR and give it a test.

p.s. This project is really cool ⭐

fonsecas72 commented 4 years ago

this is a great idea ☝️ let's do it! 👍 😄

Place1 commented 3 years ago

Hey all, thanks to @timtorChen we now have docker images built for ARM. https://hub.docker.com/repository/docker/place1/wg-access-server/tags?page=1

I don't have an ARM device handy to test; let me know if it's working. The docs will also need to include a section, perhaps someone here could contribute a "quick start" article in the docs for setting up the server on ARM (like a rasberry pi)

fonsecas72 commented 3 years ago

Works for me! (arm64 Raspberry Pi 4 with ubuntu20) 🚀 👏

miberecz commented 3 years ago

I'm trying to run it on an Orange Pi Zero, but I got this:

root@opi:/etc/wgaccess# docker-compose up
Starting wg-access-server ...
Starting wg-access-server ... done
Attaching to wg-access-server
wg-access-server    | standard_init_linux.go:211: exec user process caused "exec format error"
wg-access-server exited with code 1

I'm using the provided docker-compose.yml. Any idea what am I missing?

fonsecas72 commented 3 years ago

Did you used the "master" tag ? perhaps it's not working with armv7 ?

miberecz commented 3 years ago

Most probably not. How do I use that?

fonsecas72 commented 3 years ago

try putting place1/wg-access-server:master as the image in your docker-compose.yml . if that does not work it probably means the image does not support your armv7

miberecz commented 3 years ago

Wonderful, with the master tag its working. So I can confirm it it is good for armv7 aswell.

Maybe offtopic, or should I open a new issue. I just noticed two warnings:

wg-access-server    | time="2020-10-16T14:44:51Z" level=warning msg="[DEPRECATION NOTICE] using file:// storage is deprecated and will be removed in an upcoming minor release. Please use sqlite3:// for filesystem based storage." file="contracts.go:55"
wg-access-server    | time="2020-10-16T14:44:51Z" level=info msg="storing data in /data" file="contracts.go:56"
wg-access-server    | time="2020-10-16T14:44:51Z" level=warning msg="[DEPRECATION NOTICE] using wg-access-server without an admin user is deprecated and will be removed in an upcoming minor release." file="main.go:98"

will there be new docker-compose file described in the docs to solve these for one who not so good with docker?

Place1 commented 3 years ago

@mqmq0 yep you're right; i do plan to update the docker-compose file, k8s quick start and helm chart + all the docs at some point.

I'm deprecating file:// based storage in favor of SQL in the next point release. i'm part way through this work on master currently.