From 3002290d98c31dc941b33946197e7f58c7ff9dad Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 20 Nov 2018 07:08:03 +0100 Subject: Makefile: Build Rust code on Ubuntu Trusty My production server is on Ubuntu 14.04, but I was building the FastCGI executables with Debian Stretch. Discovered the problem like this: $ ./fulfillment.fcgi ./fulfillment.fcgi: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory $ ldd fulfillment.fcgi linux-vdso.so.1 => (0x000003a94301e000) libssl.so.1.1 => not found libcrypto.so.1.1 => not found libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x000003a94273d000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x000003a942535000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x000003a942317000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x000003a942101000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x000003a941d38000) /lib64/ld-linux-x86-64.so.2 (0x000003a942dfe000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x000003a941a32000) In order to link against the right dynamic libraries, build on Ubuntu Trusty. To do that, I downloaded the Dockerfile at: https://github.com/rust-lang-nursery/docker-rust/blob/c34d6993e8f9403c18f348de85787f1585fd3375/1.30.1/stretch/Dockerfile and changed the first line to: FROM buildpack-deps:trusty I then built an image from the Dockerfile and tagged it: $ docker image build . $ docker image tag IMAGE_ID rust:1.30.1-trusty --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5935744..a93270d 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ license-generator/target/release/license: --tty \ --volume $$PWD/license-generator:/app \ --workdir /app \ - rust:1.30.1-stretch \ + rust:1.30.1-trusty \ cargo build --release .PHONY: deploy -- cgit v1.2.3