I’m trying to create a plugin based on the example docs provided and get stuck on the build step (Golang plugins).
docker run --rm -v `pwd`:/plugin-source \
--platform=linux/amd64 \
tykio/tyk-plugin-compiler:v5.2.5 plugin.so
PLUGIN_BUILD_PATH: /go/src/[github.com/TykTechnologies/plugin_plugin](http://github.com/TykTechnologies/plugin_plugin)
PLUGIN_SOURCE_PATH: /plugin-source
INFO: No plugin id provided, keeping go.mod as is
go: errors parsing go.mod:
/go/src/[github.com/TykTechnologies/plugin_plugin/go.mod:3](http://github.com/TykTechnologies/plugin_plugin/go.mod:3): invalid go version '1.22.1': must match format 1.23
I’ve tried changing the go version in go.mod
to 1.22
to try and heed to error message, but then get a different error message saying that it “cannot compile Go 1.22 code.”
docker run --rm -v `pwd`:/plugin-source \
--platform=linux/amd64 \
tykio/tyk-plugin-compiler:v5.2.5 plugin.so
PLUGIN_BUILD_PATH: /go/src/[github.com/TykTechnologies/plugin_plugin](http://github.com/TykTechnologies/plugin_plugin)
PLUGIN_SOURCE_PATH: /plugin-source
INFO: No plugin id provided, keeping go.mod as is
tyk-plugin: cannot compile Go 1.22 code
I’m currently running this command on an M1 mac, but was able to confirm that my colleague was running into a similar issue on his linux workstation. I am able to compile if I drop our gateway and compiler version to 5.0.0, so it’s not just an issue with my local setup.
$ go version
go version go1.22.1 darwin/arm64
$ docker version
Client: Docker Engine - Community
Version: 24.0.6
API version: 1.43
Go version: go1.21.1
Git commit: ed223bc820
Built: Thu Aug 31 17:24:32 2023
OS/Arch: darwin/arm64
Context: desktop-linux
Server: Docker Desktop 4.24.2 (124339)
Engine:
Version: 24.0.6
API version: 1.43 (minimum version 1.12)
Go version: go1.20.7
Git commit: 1a79695
Built: Mon Sep 4 12:31:36 2023
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: 1.6.22
GitCommit: 8165feabfdfe38c65b599c4993d227328c231fca
runc:
Version: 1.1.8
GitCommit: v1.1.8-0-g82f18fe
docker-init:
Version: 0.19.0
GitCommit: de40ad0
$ docker-compose version
Docker Compose version 2.24.3
Thanks for any help.