build: Fix rpath to refer to absolute location

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>
This commit is contained in:
Torin Sandall
2020-12-04 13:51:28 -05:00
parent 2ff90ff4d6
commit 0625a798c7
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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"]
+1 -1
View File
@@ -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