Linking Error in Docker

I am trying to build a rust project in the rust nightly docker containers (https://hub.docker.com/r/rustlang/rust) using the slim tag. The build succeeds in the non slim tag but fails with this error in the slim tag. I cannot figure out what dependency I need to install and was wondering if anyone had any idea what was needed.

Step 11/17 : RUN cargo build --verbose
 ---> Running in 40542bcd2cba
       Fresh semver-parser v0.7.0
       Fresh autocfg v0.1.4
       Fresh rand_core v0.4.0
       Fresh unicode-xid v0.1.0
       Fresh matches v0.1.8
       Fresh cc v1.0.37
       Fresh version_check v0.1.5
       Fresh cfg-if v0.1.9
       Fresh smallvec v0.6.10
       Fresh yansi v0.4.0
       Fresh lazy_static v1.3.0
       Fresh percent-encoding v1.0.1
       Fresh untrusted v0.6.2
       Fresh scopeguard v1.0.0
       Fresh safemem v0.3.0
       Fresh traitobject v0.1.0
       Fresh language-tags v0.2.2
       Fresh yansi v0.5.0
       Fresh typeable v0.1.2
       Fresh indexmap v1.0.2
       Fresh slab v0.4.2
       Fresh state v0.4.1
       Fresh same-file v1.0.4
       Fresh lazycell v1.2.1
       Fresh itoa v0.4.4
       Fresh semver v0.9.0
       Fresh rand_core v0.3.1
       Fresh rand_jitter v0.1.4
       Fresh unicode-bidi v0.3.4
       Fresh unicode-normalization v0.1.8
       Fresh log v0.4.6
       Fresh lock_api v0.2.0
       Fresh walkdir v2.2.8
       Fresh libc v0.2.58
       Fresh rustc_version v0.2.3
       Fresh proc-macro2 v0.4.30
       Fresh rand_hc v0.1.0
       Fresh rand_isaac v0.1.1
       Fresh rand_xorshift v0.1.1
       Fresh byteorder v1.3.2
       Fresh idna v0.1.5
       Fresh log v0.3.9
       Fresh bitflags v1.1.0
       Fresh httparse v1.3.3
       Fresh ryu v0.2.8
       Fresh pq-sys v0.4.6
       Fresh memchr v2.2.0
       Fresh rand_os v0.1.3
       Fresh rand_pcg v0.1.2
       Fresh time v0.1.42
       Fresh num_cpus v1.10.1
       Fresh iovec v0.1.2
       Fresh net2 v0.2.33
       Fresh inotify-sys v0.1.3
       Fresh filetime v0.2.5
       Fresh atty v0.2.11
       Fresh quote v0.6.12
       Fresh rand_chacha v0.1.1
       Fresh ring v0.13.5
       Fresh base64 v0.9.3
       Fresh base64 v0.10.1
       Fresh mime v0.2.6
       Fresh url v1.7.2
       Fresh unicase v1.4.2
       Fresh mio v0.6.19
       Fresh syn v0.15.37
       Fresh inotify v0.6.1
       Fresh rand v0.6.5
       Fresh hyper v0.10.16
       Fresh cookie v0.11.1
       Fresh devise_core v0.2.0
       Fresh pear_codegen v0.1.2
       Fresh serde_derive v1.0.92
       Fresh diesel_derives v1.4.0
       Fresh mio-extras v2.0.5
       Fresh parking_lot_core v0.5.0
       Fresh devise_codegen v0.2.0
       Fresh pear v0.1.2
       Fresh serde v1.0.92
       Fresh notify v4.0.12
       Fresh parking_lot v0.8.0
       Fresh devise v0.2.0
       Fresh rocket_http v0.4.1
       Fresh toml v0.4.10
       Fresh serde_json v1.0.39
       Fresh scheduled-thread-pool v0.2.1
       Fresh rocket_codegen v0.4.1
       Fresh rocket_contrib_codegen v0.4.1
       Fresh r2d2 v0.8.5
       Fresh rocket v0.4.1
       Fresh diesel v1.4.2
       Fresh rocket_contrib v0.4.1
   Compiling game-code v0.1.0 (/usr/game-code)
     Running `rustc --edition=2018 --crate-name game_code src/main.rs --color never --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=5dfedf9eb9476f5a -C extra-filename=-5dfedf9eb9476f5a --out-dir /usr/game-code/target/debug/deps -C incremental=/usr/game-code/target/debug/incremental -L dependency=/usr/game-code/target/debug/deps --extern diesel=/usr/game-code/target/debug/deps/libdiesel-0a54227e292c3e28.rlib --extern rocket=/usr/game-code/target/debug/deps/librocket-1e08094214cfd18d.rlib --extern rocket_contrib=/usr/game-code/target/debug/deps/librocket_contrib-7f342bd7d4bbc019.rlib --extern serde=/usr/game-code/target/debug/deps/libserde-6e860d2b265f28c9.rlib --extern serde_json=/usr/game-code/target/debug/deps/libserde_json-4b7a9ebd8d2c6b11.rlib -L native=/usr/game-code/target/debug/build/ring-124af0ca80e93445/out`
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.11s8ry9ykb62fno4.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.15mgb9ipfdb2gavf.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.18ah9tubowstne1v.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.18ev6ztnzy6t2333.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.1dx0qplkog6h83bn.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.1fen4k08pz47kmbr.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.1myjbgk52qyvqgk1.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.1qvh6tgz4j6jhlnr.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.1s5uoxjrjichx5c0.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.1wll4l94mp9aqoih.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.1z5dr990kivmx6gh.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.21my1lcpo2dmjiu9.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.23lhejtxma4k6ft3.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.28v40uyf1s4g08aw.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.2en8ejpm3jtqiyts.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.2f7bz89mfxucng6z.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.2gaytq23gai1d8qh.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.2ier8klsfvgdtd17.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.2shdscduihet509d.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.2ssnuu0ha3w2mbwf.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.2vocqw8xnde3oefn.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.2xcp1lvol3eliokm.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.2ypbj6zh7m404myp.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.3ffx02le7iwbkajw.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.3gqgk7svd3pucoga.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.3tga88pcm9nlkjiu.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.3xe9a04uczqkq09g.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.3xhdcqmxr12l3kqk.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.3ysyiscf8cugqs1u.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.402dtk2dltz8d32e.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.46imhqjqlsu4nvzl.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.48qh6u6ziidpr1cf.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.4ijshpxpa9gik6s6.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.4m2b743t942bwzi6.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.4nypwbhauuj4fsna.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.4rmsp0nk4jw5nxxu.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.54vos8om501grjty.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.59b05uz9vrvfr76b.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.5agtqge3wogwoohq.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.5ckmnmhcjavqd189.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.5eg2itu2kp1cx67j.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.5erqjkr33bk928c5.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.5fnd6mxgtqgwsih7.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.hvxk9ppvzpdtx53.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.o3jbbfdhhytt1kz.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.t5lmhbyh0u230am.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.wzv6qtb4r1wguac.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.x49y9ws2u7dy7kw.rcgu.o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.x56z1lbn6o08fiu.rcgu.o" "-o" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a" "/usr/game-code/target/debug/deps/game_code-5dfedf9eb9476f5a.1j88vc5ijc5crrjk.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/usr/game-code/target/debug/deps" "-L" "/usr/game-code/target/debug/build/ring-124af0ca80e93445/out" "-L" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/usr/game-code/target/debug/deps/librocket_contrib-7f342bd7d4bbc019.rlib" "/usr/game-code/target/debug/deps/libdiesel-0a54227e292c3e28.rlib" "/usr/game-code/target/debug/deps/libpq_sys-a00e9aaf3ddd204c.rlib" "/usr/game-code/target/debug/deps/libbitflags-73be741a2a2cf4a1.rlib" "/usr/game-code/target/debug/deps/libr2d2-7b817610e501799a.rlib" "/usr/game-code/target/debug/deps/libscheduled_thread_pool-b6b1ef5636104c76.rlib" "/usr/game-code/target/debug/deps/libparking_lot-cde5d95aeb38b580.rlib" "/usr/game-code/target/debug/deps/libparking_lot_core-098702462e9f53cb.rlib" "/usr/game-code/target/debug/deps/librand-14684cb569423117.rlib" "/usr/game-code/target/debug/deps/librand_xorshift-7a7b8e330cae8ca2.rlib" "/usr/game-code/target/debug/deps/librand_pcg-cd54fd2dbfba092c.rlib" "/usr/game-code/target/debug/deps/librand_hc-03a987ced9c75552.rlib" "/usr/game-code/target/debug/deps/librand_chacha-fd3a68bf0bc9a262.rlib" "/usr/game-code/target/debug/deps/librand_isaac-c1f831b38b9ffe2c.rlib" "/usr/game-code/target/debug/deps/librand_core-b00338b3f001a709.rlib" "/usr/game-code/target/debug/deps/librand_os-6626077f1cb16d69.rlib" "/usr/game-code/target/debug/deps/librand_jitter-1b046558fa23318a.rlib" "/usr/game-code/target/debug/deps/librand_core-5f9ef9314a537e1f.rlib" "/usr/game-code/target/debug/deps/liblock_api-32938a9a997b8b86.rlib" "/usr/game-code/target/debug/deps/libscopeguard-992603f341369cfc.rlib" "/usr/game-code/target/debug/deps/libserde_json-4b7a9ebd8d2c6b11.rlib" "/usr/game-code/target/debug/deps/libryu-ed920c19f3339d1f.rlib" "/usr/game-code/target/debug/deps/libitoa-6a4e6329f5446f3b.rlib" "/usr/game-code/target/debug/deps/librocket-1e08094214cfd18d.rlib" "/usr/game-code/target/debug/deps/libatty-abdbe7e11c0afab3.rlib" "/usr/game-code/target/debug/deps/libbase64-84b7325ae2973d11.rlib" "/usr/game-code/target/debug/deps/libmemchr-25511bb09a2fe17f.rlib" "/usr/game-code/target/debug/deps/libtoml-70152b212d5aef57.rlib" "/usr/game-code/target/debug/deps/libserde-6e860d2b265f28c9.rlib" "/usr/game-code/target/debug/deps/libyansi-af1f767dc308cc1c.rlib" "/usr/game-code/target/debug/deps/librocket_http-f3a851fdefa34d6e.rlib" "/usr/game-code/target/debug/deps/libhyper-ccb337a4d106f78c.rlib" "/usr/game-code/target/debug/deps/libmime-4aad16d516c5246a.rlib" "/usr/game-code/target/debug/deps/liblog-cb5344f54c8a4106.rlib" "/usr/game-code/target/debug/deps/liblog-c8ed010a62e15430.rlib" "/usr/game-code/target/debug/deps/libcfg_if-fea90f8df0493020.rlib" "/usr/game-code/target/debug/deps/liblanguage_tags-434804452306ae7e.rlib" "/usr/game-code/target/debug/deps/libtypeable-fbd14402e40c9785.rlib" "/usr/game-code/target/debug/deps/libtraitobject-755849350b573e40.rlib" "/usr/game-code/target/debug/deps/libnum_cpus-cd9f87b233963e8b.rlib" "/usr/game-code/target/debug/deps/libhttparse-209e819bba5986ae.rlib" "/usr/game-code/target/debug/deps/libunicase-fa931626b065483d.rlib" "/usr/game-code/target/debug/deps/libunicode_xid-96ab504864976ba1.rlib" "/usr/game-code/target/debug/deps/libstate-66e39a6855d9d87b.rlib" "/usr/game-code/target/debug/deps/libindexmap-3b392cf6583cadf2.rlib" "/usr/game-code/target/debug/deps/libcookie-8d2e11b0131c1b3b.rlib" "/usr/game-code/target/debug/deps/libbase64-3c53e23e0c4db223.rlib" "/usr/game-code/target/debug/deps/libsafemem-2bfd7a964f75d14c.rlib" "/usr/game-code/target/debug/deps/libbyteorder-ce59543764ba880d.rlib" "/usr/game-code/target/debug/deps/libring-372be66c6ba8cb6e.rlib" "/usr/game-code/target/debug/deps/libuntrusted-5adf059028d27ff3.rlib" "/usr/game-code/target/debug/deps/liblazy_static-c8b5f3ec7869bf23.rlib" "/usr/game-code/target/debug/deps/libtime-112eeff81aa48d04.rlib" "/usr/game-code/target/debug/deps/liblibc-b7debf4ecbcddbce.rlib" "/usr/game-code/target/debug/deps/liburl-4804216f3d0f06ee.rlib" "/usr/game-code/target/debug/deps/libidna-ea955e7fa7d1ec09.rlib" "/usr/game-code/target/debug/deps/libunicode_normalization-fbfb0de123be15ec.rlib" "/usr/game-code/target/debug/deps/libunicode_bidi-83062ed983a65d24.rlib" "/usr/game-code/target/debug/deps/libmatches-03658943abb3c1a8.rlib" "/usr/game-code/target/debug/deps/libsmallvec-5914d0fd1b5f1cc8.rlib" "/usr/game-code/target/debug/deps/libpercent_encoding-89774180145c9086.rlib" "/usr/game-code/target/debug/deps/libpear-de0a62d5e7a1c4ab.rlib" "-Wl,--start-group" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-8bb90dec5122c12a.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-78c4933b79cb0957.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace-d2e3cc1e3a1048a0.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-a1620f034211c70b.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-ec9352dd96f7df2a.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-8c3c6c19ae137ab7.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-62e265999e5db9c8.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-1d037a547a1cad5e.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-3471ca685d840226.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-81d2e4fb78255d6f.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-48a0cdfc60b45f07.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-a690ce481db99c1b.rlib" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-d7974c5f77fd9dfe.rlib" "-Wl,--end-group" "/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-e5d1063a6b1437c2.rlib" "-Wl,-Bdynamic" "-lpq" "-lutil" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
  = note: /usr/bin/ld: cannot find -lpq
          collect2: error: ld returned 1 exit status


error: aborting due to previous error

error: Could not compile `game-code`.

Caused by:
  process didn't exit successfully: `rustc --edition=2018 --crate-name game_code src/main.rs --color never --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=5dfedf9eb9476f5a -C extra-filename=-5dfedf9eb9476f5a --out-dir /usr/game-code/target/debug/deps -C incremental=/usr/game-code/target/debug/incremental -L dependency=/usr/game-code/target/debug/deps --extern diesel=/usr/game-code/target/debug/deps/libdiesel-0a54227e292c3e28.rlib --extern rocket=/usr/game-code/target/debug/deps/librocket-1e08094214cfd18d.rlib --extern rocket_contrib=/usr/game-code/target/debug/deps/librocket_contrib-7f342bd7d4bbc019.rlib --extern serde=/usr/game-code/target/debug/deps/libserde-6e860d2b265f28c9.rlib --extern serde_json=/usr/game-code/target/debug/deps/libserde_json-4b7a9ebd8d2c6b11.rlib -L native=/usr/game-code/target/debug/build/ring-124af0ca80e93445/out` (exit code: 1)
The command '/bin/sh -c cargo build --verbose' returned a non-zero code: 101
cannot find -lpq

You will need to install libpq inside the container, as diesel depends on it to connect to a PostgreSQL database.