Skip to content

Commit

Permalink
build: Fix rpath to refer to absolute location
Browse files Browse the repository at this point in the history
We originally set the rpath to be relative to the $ORIGIN which
apparently changes if the working directory is overriden. This change
just fixes the rpath to contain /usr/lib/opa and then updates the
Dockerfile to copy the libwasmer.so file into this new directory.

Fixes #2974

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
  • Loading branch information
tsandall committed Dec 4, 2020
1 parent 2ff90ff commit 0625a79
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ USER ${USER}

ARG BIN_DIR=.
COPY ${BIN_DIR}/opa_docker_amd64 /opa
COPY ./vendor/github.com/wasmerio/go-ext-wasm/wasmer/libwasmer.so /libwasmer.so
COPY ./vendor/github.com/wasmerio/go-ext-wasm/wasmer/libwasmer.so /usr/lib/opa/libwasmer.so

ENTRYPOINT ["/opa"]
CMD ["run"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ ci-wasm: wasm-test

.PHONY: build-docker
build-docker: ensure-release-dir
CGO_LDFLAGS="-Wl,-rpath -Wl,./$$ORIGIN" $(GO) build $(GO_TAGS) -o $(RELEASE_DIR)/opa_docker_$(GOARCH) -ldflags $(LDFLAGS)
CGO_LDFLAGS="-Wl,-rpath,/usr/lib/opa" $(GO) build $(GO_TAGS) -o $(RELEASE_DIR)/opa_docker_$(GOARCH) -ldflags $(LDFLAGS)

.PHONY: build-linux
build-linux: ensure-release-dir
Expand Down

0 comments on commit 0625a79

Please sign in to comment.