Repository: dani-garcia/vaultwarden

Issue #530: MySQL images for Alpine and ARM devices not building correctly
Created: 2019-07-13T23:36:41Z
Hey all,
I run successfully bitwardenrs/server:latest. I wanted to add MySQL and went on trying bitwardenrs/server-mysql:latest and bitwardenrs/server-mysql:alpine, to no avail.
The errors are "standard_init_linux.go:207: exec user process caused "no such file or directory" in the case of alpine, and in the other case I can't gather much because my log is truncated. I will try to find better log, but meanwhile in the case of alpine it seems that something was possibly renamed and forgot to update all the occurences
Thank you

Duplicate issue #823: ARM Docker image build fails
Created: 2020-01-20T09:58:25Z
Subject of the issue

The current MySQL Dockerfiles for ARM don't build. Generated PostgreSQL Dockerfiles also don't work for ARM.
Your environment


Bitwarden_rs version: -



Install method:
Clients used: 
Reverse proxy and version: 
Version of mysql/postgresql: 
Other relevant information: I'm building the master branch

Steps to reproduce


(Optional) Refresh Dockerfiles with template
Remove symlink to amd64 Dockerfile and replace it with the corresponding arm Dockerfile (e.g. docker/armv7/mysql/Dockerfile)
Build the Docker image with docker build -t bitwarden_rs:arm .

Expected behaviour

Docker successfully builds the image
Actual behaviour

Compilation fails during the linking stage
Relevant logs

MySQL:
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/app/target/release/deps/migrations_macros-8eb80f71657e520c.migrations_macros.cz7rf6f0-cgu.0.rcgu.o" "/app/target/release/deps/migrations_macros-8eb80f71657e520c.migrations_macros.cz7rf6f0-cgu.1.rcgu.o" "/app/target/release/deps/migrations_macros-8eb80f71657e520c.migrations_macros.cz7rf6f0-cgu.10.rcgu.o" "/app/target/release/deps/migrations_macros-8eb80f71657e520c.migrations_macros.cz7rf6f0-cgu.11.rcgu.o" "/app/target/release/deps/migrations_macros-8eb80f71657e520c.migrations_macros.cz7rf6f0-cgu.12.rcgu.o" "/app/target/release/deps/migrations_macros-8eb80f71657e520c.migrations_macros.cz7rf6f0-cgu.13.rcgu.o" "/app/target/release/deps/migrations_macros-8eb80f71657e520c.migrations_macros.cz7rf6f0-cgu.14.rcgu.o" "/app/target/release/deps/migrations_macros-8eb80f71657e520c.migrations_macros.cz7rf6f0-cgu.15.rcgu.o" "/app/target/release/deps/migrations_macros-8eb80f71657e520c.migrations_macros.cz7rf6f0-cgu.2.rcgu.o" "/app/target/release/deps/migrations_macros-8eb80f71657e520c.migrations_macros.cz7rf6f0-cgu.3.rcgu.o" "/app/target/release/deps/migrations_macros-8eb80f71657e520c.migrations_macros.cz7rf6f0-cgu.4.rcgu.o" "/app/target/release/deps/migrations_macros-8eb80f71657e520c.migrations_macros.cz7rf6f0-cgu.5.rcgu.o" "/app/target/release/deps/migrations_macros-8eb80f71657e520c.migrations_macros.cz7rf6f0-cgu.6.rcgu.o" "/app/target/release/deps/migrations_macros-8eb80f71657e520c.migrations_macros.cz7rf6f0-cgu.7.rcgu.o" "/app/target/release/deps/migrations_macros-8eb80f71657e520c.migrations_macros.cz7rf6f0-cgu.8.rcgu.o" "/app/target/release/deps/migrations_macros-8eb80f71657e520c.migrations_macros.cz7rf6f0-cgu.9.rcgu.o" "-o" "/app/target/release/deps/libmigrations_macros-8eb80f71657e520c.so" "/app/target/release/deps/migrations_macros-8eb80f71657e520c.1ttffrxicxvw653d.rcgu.o" "/app/target/release/deps/migrations_macros-8eb80f71657e520c.57avd4t4cdt0zwlt.rcgu.o" "-Wl,--gc-sections" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/app/target/release/deps" "-L" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/app/target/release/deps/libsyn-125852c65d6dd34a.rlib" "/app/target/release/deps/libquote-d73a24f74cc9a0cf.rlib" "/app/target/release/deps/libproc_macro2-389ea863597adec1.rlib" "/app/target/release/deps/libunicode_xid-c1442ebedcbf3008.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libproc_macro-98dc55bc8fe9a654.rlib" "/app/target/release/deps/libmigrations_internals-bccc04738bad5ed1.rlib" "/app/target/release/deps/libdiesel-25e8e2d42bdeb339.rlib" "/app/target/release/deps/libchrono-60bbc678cdac0d41.rlib" "/app/target/release/deps/libnum_integer-feb3069b79fe62b0.rlib" "/app/target/release/deps/libnum_traits-0b4285abff20c8d9.rlib" "/app/target/release/deps/libtime-d3eb3f9e795a073e.rlib" "/app/target/release/deps/liburl-8eba047975821534.rlib" "/app/target/release/deps/libpercent_encoding-a2930b04d748d192.rlib" "/app/target/release/deps/libidna-c38d7ea5380dee01.rlib" "/app/target/release/deps/libunicode_normalization-5e4227f0336da416.rlib" "/app/target/release/deps/libunicode_bidi-1e92a199e085d957.rlib" "/app/target/release/deps/libmatches-755f812bdf641201.rlib" "/app/target/release/deps/libmysqlclient_sys-dd8e3029828a7e0b.rlib" "/app/target/release/deps/libr2d2-187cc4df1d9ebc4f.rlib" "/app/target/release/deps/libscheduled_thread_pool-3d6b0f07f7ef4e65.rlib" "/app/target/release/deps/libparking_lot-56d344fdbbf5e9d9.rlib" "/app/target/release/deps/libparking_lot_core-a56f936b7a4ecbe6.rlib" "/app/target/release/deps/liblibc-a86d7b68eca97cad.rlib" "/app/target/release/deps/libsmallvec-2d779df16a9bdf20.rlib" "/app/target/release/deps/liblock_api-56570892924d9aa4.rlib" "/app/target/release/deps/libscopeguard-118b8938a60bf1f5.rlib" "/app/target/release/deps/liblog-bc100828683048ce.rlib" "/app/target/release/deps/libcfg_if-3a7a38ac865eefce.rlib" "/app/target/release/deps/libbyteorder-0651b5d3124addb5.rlib" "-Wl,--start-group" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-062f52e9022cbb17.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-67b317918d7f9def.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-a2b714bd1e0b9a26.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-b8587dae402088fa.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace-366d0fd7abb3155c.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-25723b5559062583.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-29df7bebd8019c32.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-1aa8d768a0a3e08a.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-77e1fe849308a0d9.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-d0f5a404bce951f8.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-6a9f051def85efb5.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-66157f5adddec2d5.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-d7115120da3a479c.rlib" "-Wl,--end-group" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-35771ab8ed32c40d.rlib" "-Wl,-Bdynamic" "-lmysqlclient" "-lutil" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil" "-shared"
  = note: /usr/bin/ld: cannot find -lmysqlclient
          collect2: error: ld returned 1 exit status


error: aborting due to previous error

error: could not compile `migrations_macros`.
warning: build failed, waiting for other jobs to finish...
error: build failed
The command '/bin/sh -c cargo build --features ${DB} --release' returned a non-zero code: 101

PostgreSQL:
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/app/target/release/deps/migrations_macros-8c7b32241a32fda3.migrations_macros.36cds3xi-cgu.0.rcgu.o" "/app/target/release/deps/migrations_macros-8c7b32241a32fda3.migrations_macros.36cds3xi-cgu.1.rcgu.o" "/app/target/release/deps/migrations_macros-8c7b32241a32fda3.migrations_macros.36cds3xi-cgu.10.rcgu.o" "/app/target/release/deps/migrations_macros-8c7b32241a32fda3.migrations_macros.36cds3xi-cgu.11.rcgu.o" "/app/target/release/deps/migrations_macros-8c7b32241a32fda3.migrations_macros.36cds3xi-cgu.12.rcgu.o" "/app/target/release/deps/migrations_macros-8c7b32241a32fda3.migrations_macros.36cds3xi-cgu.13.rcgu.o" "/app/target/release/deps/migrations_macros-8c7b32241a32fda3.migrations_macros.36cds3xi-cgu.14.rcgu.o" "/app/target/release/deps/migrations_macros-8c7b32241a32fda3.migrations_macros.36cds3xi-cgu.15.rcgu.o" "/app/target/release/deps/migrations_macros-8c7b32241a32fda3.migrations_macros.36cds3xi-cgu.2.rcgu.o" "/app/target/release/deps/migrations_macros-8c7b32241a32fda3.migrations_macros.36cds3xi-cgu.3.rcgu.o" "/app/target/release/deps/migrations_macros-8c7b32241a32fda3.migrations_macros.36cds3xi-cgu.4.rcgu.o" "/app/target/release/deps/migrations_macros-8c7b32241a32fda3.migrations_macros.36cds3xi-cgu.5.rcgu.o" "/app/target/release/deps/migrations_macros-8c7b32241a32fda3.migrations_macros.36cds3xi-cgu.6.rcgu.o" "/app/target/release/deps/migrations_macros-8c7b32241a32fda3.migrations_macros.36cds3xi-cgu.7.rcgu.o" "/app/target/release/deps/migrations_macros-8c7b32241a32fda3.migrations_macros.36cds3xi-cgu.8.rcgu.o" "/app/target/release/deps/migrations_macros-8c7b32241a32fda3.migrations_macros.36cds3xi-cgu.9.rcgu.o" "-o" "/app/target/release/deps/libmigrations_macros-8c7b32241a32fda3.so" "/app/target/release/deps/migrations_macros-8c7b32241a32fda3.1fc3brw45s5r77xr.rcgu.o" "/app/target/release/deps/migrations_macros-8c7b32241a32fda3.k9ksenhi1j4hzy9.rcgu.o" "-Wl,--gc-sections" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/app/target/release/deps" "-L" "/usr/lib/arm-linux-gnueabihf" "-L" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/app/target/release/deps/libsyn-125852c65d6dd34a.rlib" "/app/target/release/deps/libquote-d73a24f74cc9a0cf.rlib" "/app/target/release/deps/libproc_macro2-389ea863597adec1.rlib" "/app/target/release/deps/libunicode_xid-c1442ebedcbf3008.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libproc_macro-98dc55bc8fe9a654.rlib" "/app/target/release/deps/libmigrations_internals-2bb4eeec79013890.rlib" "/app/target/release/deps/libdiesel-9b32b564fc0240f7.rlib" "/app/target/release/deps/libpq_sys-2b5c73d7c03b50ee.rlib" "/app/target/release/deps/libchrono-60bbc678cdac0d41.rlib" "/app/target/release/deps/libnum_integer-feb3069b79fe62b0.rlib" "/app/target/release/deps/libnum_traits-0b4285abff20c8d9.rlib" "/app/target/release/deps/libtime-d3eb3f9e795a073e.rlib" "/app/target/release/deps/libr2d2-187cc4df1d9ebc4f.rlib" "/app/target/release/deps/libscheduled_thread_pool-3d6b0f07f7ef4e65.rlib" "/app/target/release/deps/libparking_lot-56d344fdbbf5e9d9.rlib" "/app/target/release/deps/libparking_lot_core-a56f936b7a4ecbe6.rlib" "/app/target/release/deps/liblibc-a86d7b68eca97cad.rlib" "/app/target/release/deps/libsmallvec-2d779df16a9bdf20.rlib" "/app/target/release/deps/liblock_api-56570892924d9aa4.rlib" "/app/target/release/deps/libscopeguard-118b8938a60bf1f5.rlib" "/app/target/release/deps/liblog-bc100828683048ce.rlib" "/app/target/release/deps/libcfg_if-3a7a38ac865eefce.rlib" "/app/target/release/deps/libbyteorder-0651b5d3124addb5.rlib" "/app/target/release/deps/libbitflags-0eca6cc8b01ab893.rlib" "-Wl,--start-group" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-062f52e9022cbb17.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-67b317918d7f9def.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-a2b714bd1e0b9a26.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-b8587dae402088fa.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace-366d0fd7abb3155c.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-25723b5559062583.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-29df7bebd8019c32.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-1aa8d768a0a3e08a.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-77e1fe849308a0d9.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-d0f5a404bce951f8.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-6a9f051def85efb5.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-66157f5adddec2d5.rlib" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-d7115120da3a479c.rlib" "-Wl,--end-group" "/usr/local/rustup/toolchains/nightly-2019-12-19-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-35771ab8ed32c40d.rlib" "-Wl,-Bdynamic" "-lpq" "-lutil" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil" "-shared"
  = note: /usr/bin/ld: skipping incompatible /usr/lib/arm-linux-gnueabihf/libpq.so when searching for -lpq
          /usr/bin/ld: skipping incompatible /usr/lib/arm-linux-gnueabihf/libpq.a when searching for -lpq
          /usr/bin/ld: cannot find -lpq
          /usr/bin/ld: skipping incompatible /usr/lib/arm-linux-gnueabihf/libutil.so when searching for -lutil
          /usr/bin/ld: skipping incompatible /usr/lib/arm-linux-gnueabihf/libutil.a when searching for -lutil
          /usr/bin/ld: skipping incompatible /usr/lib/arm-linux-gnueabihf/libutil.so when searching for -lutil
          /usr/bin/ld: skipping incompatible /usr/lib/arm-linux-gnueabihf/libutil.a when searching for -lutil
          /usr/bin/ld: skipping incompatible /usr/lib/arm-linux-gnueabihf/libdl.so when searching for -ldl
          /usr/bin/ld: skipping incompatible /usr/lib/arm-linux-gnueabihf/libdl.a when searching for -ldl
          /usr/bin/ld: skipping incompatible /usr/lib/arm-linux-gnueabihf/librt.so when searching for -lrt
          /usr/bin/ld: skipping incompatible /usr/lib/arm-linux-gnueabihf/librt.a when searching for -lrt
          /usr/bin/ld: skipping incompatible /usr/lib/arm-linux-gnueabihf/libpthread.so when searching for -lpthread
          /usr/bin/ld: skipping incompatible /usr/lib/arm-linux-gnueabihf/libpthread.a when searching for -lpthread
          collect2: error: ld returned 1 exit status


error: aborting due to previous error

   Compiling rocket_contrib v0.5.0-dev (https://github.com/SergioBenitez/Rocket?rev=b95b6765e1cc8be7c1e7eaef8a9d9ad940b0ac13#b95b6765)
error: could not compile `migrations_macros`.
warning: build failed, waiting for other jobs to finish...
error: build failed
The command '/bin/sh -c cargo build --features ${DB} --release' returned a non-zero code: 101

Closing comment (2020-01-29T11:42:39Z): @SuNNjek I was asking @lambro690, because the cross-build-start step is after the linking issue that you experience. So I think it's not relevant for you.
As for your problem, this seems to be a duplicate of #530. There seems to be some problem with statically linking the mysql libs. AFAIK no one managed to cross-compile the binary.