valeriansaliou / raider

🐎 Affiliates dashboard. Used by affiliates to generate tracking codes and review their balance.
https://crates.io/crates/raider-server
Mozilla Public License 2.0
158 stars 35 forks source link

Unable to build docker container #2

Closed x1ddos closed 4 years ago

x1ddos commented 4 years ago

First, I think libssl-dev is missing during the build. Moved it like in this patch:

diff --git Dockerfile Dockerfile
index 5845a11..08f1171 100644
--- Dockerfile
+++ Dockerfile
@@ -12,6 +12,9 @@ RUN rustc --version && \
     rustup --version && \
     cargo --version

+RUN apt-get update
+RUN apt-get install -y libssl-dev default-libmysqlclient-dev
+
 RUN cargo clean && cargo build --release
 RUN strip ./target/release/raider

@@ -22,9 +25,6 @@ WORKDIR /usr/src/raider
 COPY ./res/assets/ ./res/assets/
 COPY --from=build /app/target/release/raider /usr/local/bin/raider

-RUN apt-get update
-RUN apt-get install -y libssl-dev default-libmysqlclient-dev
-
 CMD [ "raider", "-c", "/etc/raider.cfg" ]

 EXPOSE 8080

But even then, I suspect it fails because the installed libssl version is newer than what's expected:

$ docker build -t raider .
...
default-libmysqlclient-dev is already the newest version (1.0.5).
libssl-dev is already the newest version (1.1.1d-0+deb10u3).
...
error: failed to run custom build command for `openssl v0.9.24`
process didn't exit successfully: `/app/target/release/build/openssl-e0c9d0620fbd0538/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Unable to detect OpenSSL version', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/openssl-0.9.24/build.rs:16:14

Attached full build.log.

I'd prefer to actually not use a container but my libssl-dev version on host is newer, too. So, same result. I'll try and see if I can bump deps versions and make them use newer libssl.