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

Reference plugin_authz implementation example #378

Open
benbooth493 opened this issue Dec 5, 2023 · 0 comments
Open

Reference plugin_authz implementation example #378

benbooth493 opened this issue Dec 5, 2023 · 0 comments

Comments

@benbooth493
Copy link

benbooth493 commented Dec 5, 2023

I'm trying to write a custom plugin to use as plugin_authz but I keep getting the following message:

F1205 14:35:58.220673       1 main.go:254] Failed to load config: invalid config: bad plugin_authz config: error while loading authz plugin: plugin.Open("/plugin/authz.so"): Dynamic loading not supported

I am current using docker-compose to setup docker-registry v2 with docker_auth, and build my plugin.
I'm on M3 so as you can imagine there are a few factors involved in building the plugin correctly.

I could really benefit from a reference example of a plugin that satisfies the requirement necessary by docker_auth.
Along with this it would be lovely to have an example Dockerfile to reference for building this.

This is my current Dockerfile:

FROM golang:1.21-alpine3.18
WORKDIR /app
COPY go.mod ./
RUN apk add -U --no-cache gcc musl-dev file
RUN go mod download
COPY . .
ENV GOOS=linux
ENV GOARCH=amd64
ENV CGO_ENABLED=1
RUN go build -v -buildmode=plugin -o /build/authz.so ./...

In docker-compose I am mounting the resulting binary into docker_auth using a volume.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant