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

/bin/sh: ./opa: not found in Docker when upgrading to v0.29.4 #3532

Closed
ZachMayry opened this issue Jun 4, 2021 · 6 comments
Closed

/bin/sh: ./opa: not found in Docker when upgrading to v0.29.4 #3532

ZachMayry opened this issue Jun 4, 2021 · 6 comments

Comments

@ZachMayry
Copy link

ZachMayry commented Jun 4, 2021

Expected Behavior

OPA server runs

Actual Behavior

/bin/sh: ./opa: not found

Steps to Reproduce the Problem

dockerfile

FROM node:fermium-alpine
RUN apk update
COPY ./opa /opa
WORKDIR /
EXPOSE 8181
RUN ./opa run --server
  1. download opa curl -L -o opa https://www.openpolicyagent.org/downloads/latest/opa_linux_amd64/; chmod +x ./opa
  2. copy dockerfile to a file named Dockerfile
  3. docker build .

OPA Environment

OPA Version: 0.28.0 - works just fine
OPA Version: 0.29.4 - does not run

Exact Error message

 => ERROR [4/5] RUN ./opa run --server                                                                0.4s
------                                                                                                     
 > [4/5] RUN ./opa run --server:
#8 0.383 /bin/sh: ./opa: not found
------
executor failed running [/bin/sh -c ./opa run --server]: exit code: 127

Additional Info

0.29.4 works just fine on a Mac, just not on Linux via docker. Could be related to the image we are using but that is our standard image as all of our services run on node. We use yarn workspaces to standardize how we run our services.

@ZachMayry ZachMayry changed the title /bin/sh: ./opa: not found when upgrading to v0.29.4 /bin/sh: ./opa: not found in Docker when upgrading to v0.29.4 Jun 4, 2021
@tsandall
Copy link
Member

tsandall commented Jun 4, 2021

@ZachMayry thanks for filing this...

Can you try the same except curl for the static executable: https://www.openpolicyagent.org/downloads/latest/opa_linux_amd64_static

Some recent changes related to wasm support in OPA necessitate libc and libgcc dependencies (which aren't available in alpine). You probably don't care about wasm support for now so just use the static executable.

Assuming this fixes it, I'll send out a post on Slack and update the release notes to be more obvious about this.

Sorry for the inconvenience!

@ZachMayry
Copy link
Author

ZachMayry commented Jun 4, 2021

That works!
Will the static version continue to be supported?
Or will we need to move back to the non static version at some point?

@tsandall
Copy link
Member

tsandall commented Jun 4, 2021

Yes, the static version will be supported (and it won't magically become dynamic at some point like the other linux executable did 😅 )

@ZachMayry
Copy link
Author

What do you mean by "dynamic"?

@tsandall
Copy link
Member

tsandall commented Jun 4, 2021

It won't gain any dynamic library dependencies. The opa_linux_amd64_static is statically linked, i.e., you can it on any linux/amd64 systems as it has no system library dependencies (even libc is not needed...)

@tsandall
Copy link
Member

tsandall commented Jun 4, 2021

Closing because this is a dupe of #3499

@tsandall tsandall closed this as completed Jun 4, 2021
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

2 participants