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

Go websocket not working in oathkeeper example #1093

Open
3 of 6 tasks
Gawise opened this issue Nov 22, 2022 · 2 comments
Open
3 of 6 tasks

Go websocket not working in oathkeeper example #1093

Gawise opened this issue Nov 22, 2022 · 2 comments
Labels
bug Something is not working.

Comments

@Gawise
Copy link

Gawise commented Nov 22, 2022

Preflight checklist

Describe the bug

The go websocket container called ws in the oathkeeper example fails to build. The logs are saying that the executable in the Dockerfile's entrypoint doesn't exist.

Reproducing the bug

  1. Run cd code-examples/oathkeeper
  2. Run docker compose up --build
  3. Go to http://127.0.0.1:4455 and create an account
  4. Go to http://127.0.0.1:8080

Relevant log output

Attaching to oathkeeper-kratos-1, oathkeeper-kratos-migrate-1, oathkeeper-kratos-selfservice-ui-node-1, oathkeeper-mailslurper-1, oathkeeper-oathkeeper-1, oathkeeper-postgres-kratos-1, oathkeeper-ws-1
oathkeeper-ws-1                          | exec /ws: no such file or directory
oathkeeper-mailslurper-1                 | time="2022-11-22T23:44:31Z" level=info msg="Starting MailSlurper Server v1.14.1" who=MailSlurper

Relevant configuration

No response

Version

master

On which operating system are you observing this issue?

Linux

In which environment are you deploying?

Docker Compose

Additional Context

I ran it on WSL but it failed on Docker Desktop for Windows too.

@Gawise Gawise added the bug Something is not working. label Nov 22, 2022
@Gawise
Copy link
Author

Gawise commented Nov 23, 2022

I'm not very proficient at golang, but it seems like the problem is that the go build is made at a stage with a 'golang' base image, but is then run on a different 'alpine' image. I managed to make it work by doing everything in a 'golang:alpine' image like so:
`FROM golang:alpine

RUN mkdir /build

ADD . /build

WORKDIR /build

RUN GOOS=linux GOARCH=amd64 go build -o ws main.go

EXPOSE 8090

CMD ["/build/ws"]`

@netthier
Copy link

netthier commented Jun 14, 2023

Another fix is to switch out the image used in the second stage to debian.
Are there any plans to fix the guide though?

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

No branches or pull requests

2 participants