"linking with `cc` failed: exit code: 1" のエラーを解決する[Rust]

# 環境

- Docker
  - rust:alpine3.12

# エラー

`cargo install` しようとした場合に `error: linking with `cc` failed: exit code: 1` と吐かれる。

```sh
$ cargo install mdbook
    Updating crates.io index
  Installing mdbook v0.4.4
   Compiling libc v0.2.80
   Compiling proc-macro2 v1.0.24
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.51
   Compiling cfg-if v0.1.10
   Compiling getrandom v0.1.15
   Compiling log v0.4.11
   Compiling serde v1.0.117
   Compiling lazy_static v1.4.0
   Compiling version_check v0.9.2
   Compiling ryu v1.0.5
   Compiling typenum v1.12.0
   Compiling serde_json v1.0.59
   Compiling memchr v2.3.4
   Compiling autocfg v1.0.1
   Compiling itoa v0.4.6
   Compiling bytes v0.5.6
   Compiling ppv-lite86 v0.2.10
   Compiling cfg-if v1.0.0
   Compiling fnv v1.0.7
   Compiling siphasher v0.3.3
   Compiling slab v0.4.2
   Compiling serde_derive v1.0.117
   Compiling futures-core v0.3.8
   Compiling matches v0.1.8
   Compiling proc-macro-hack v0.5.19
   Compiling tinyvec_macros v0.1.0
   Compiling utf-8 v0.7.5
   Compiling proc-macro-nested v0.1.6
   Compiling new_debug_unreachable v1.0.4
   Compiling pin-project-internal v0.4.27
   Compiling byteorder v1.3.4
   Compiling bitflags v1.2.1
   Compiling futures-sink v0.3.8
   Compiling once_cell v1.5.2
   Compiling mac v0.1.1
   Compiling percent-encoding v2.1.0
   Compiling pin-project-lite v0.1.11
   Compiling pin-utils v0.1.0
   Compiling precomputed-hash v0.1.1
   Compiling httparse v1.3.4
   Compiling byte-tools v0.3.1
   Compiling ucd-trie v0.1.3
   Compiling pin-project-lite v0.2.0
   Compiling cpuid-bool v0.1.2
   Compiling opaque-debug v0.3.0
   Compiling hashbrown v0.9.1
   Compiling maplit v1.0.2
   Compiling unicode-width v0.1.8
   Compiling base64 v0.12.3
   Compiling unicode-segmentation v1.7.1
   Compiling regex-syntax v0.6.21
   Compiling fake-simd v0.1.2
   Compiling mime v0.3.16
   Compiling opaque-debug v0.2.3
   Compiling try-lock v0.2.3
   Compiling httpdate v0.3.2
   Compiling tower-service v0.3.0
   Compiling futures-io v0.3.8
   Compiling quick-error v1.2.3
   Compiling dtoa v0.4.6
   Compiling pulldown-cmark v0.7.2
   Compiling lazycell v1.3.0
   Compiling same-file v1.0.6
   Compiling anyhow v1.0.34
   Compiling vec_map v0.8.2
   Compiling glob v0.3.0
   Compiling termcolor v1.1.2
   Compiling urlencoding v1.1.1
   Compiling strsim v0.8.0
   Compiling ansi_term v0.11.0
   Compiling scoped-tls v1.0.0
   Compiling quick-error v2.0.0
   Compiling strum v0.18.0
   Compiling remove_dir_all v0.5.3
   Compiling shlex v0.1.1
   Compiling open v1.4.0
   Compiling tracing-core v0.1.17
   Compiling thread_local v1.0.1
   Compiling unicode-bidi v0.3.4
   Compiling tinyvec v1.1.0
   Compiling phf_shared v0.8.0
   Compiling unicase v2.6.0
   Compiling generic-array v0.14.4
   Compiling http v0.2.1
   Compiling input_buffer v0.3.1
   Compiling indexmap v1.6.0
   Compiling num-traits v0.2.14
   Compiling num-integer v0.1.44
   Compiling futf v0.1.4
   Compiling futures-channel v0.3.8
   Compiling futures-task v0.3.8
   Compiling form_urlencoded v1.0.0
   Compiling block-padding v0.1.5
   Compiling getopts v0.2.21
   Compiling textwrap v0.11.0
   Compiling pest v2.1.3
   Compiling humantime v1.3.0
   Compiling walkdir v2.3.1
   Compiling heck v0.3.1
   Compiling gitignore v1.0.7
   Compiling tendril v0.4.1
   Compiling phf v0.8.0
   Compiling unicode-normalization v0.1.16
   Compiling tracing v0.1.22
   Compiling want v0.3.0
   Compiling aho-corasick v0.7.15
   Compiling quote v1.0.7
   Compiling pest_meta v2.1.3
   Compiling iovec v0.1.4
   Compiling net2 v0.2.35
   Compiling time v0.1.44
   Compiling inotify-sys v0.1.4
   Compiling socket2 v0.3.17
   Compiling atty v0.2.14
   Compiling filetime v0.2.13
   Compiling http-body v0.3.1
   Compiling headers-core v0.2.0
   Compiling mime_guess v2.0.3
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-Wl,--eh-frame-hdr" "-L" "/usr/local/rustup/toolchains/1.48.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib" "/tmp/cargo-installa6UIqr/release/deps/proc_macro_hack-ab55b2d3c631ea17.proc_macro_hack.9cxz4p5v-cgu.0.rcgu.o" "/tmp/cargo-installa6UIqr/release/deps/proc_macro_hack-ab55b2d3c631ea17.proc_macro_hack.9cxz4p5v-cgu.1.rcgu.o" "/tmp/cargo-installa6UIqr/release/deps/proc_macro_hack-ab55b2d3c631ea17.proc_macro_hack.9cxz4p5v-cgu.10.rcgu.o" "/tmp/cargo-installa6UIqr/release/deps/proc_macro_hack-ab55b2d3c631ea17.proc_macro_hack.9cxz4p5v-cgu.11.rcgu.o" "/tmp/cargo-installa6UIqr/release/deps/proc_macro_hack-ab55b2d3c631ea17.proc_macro_hack.9cxz4p5v-cgu.12.rcgu.o" "/tmp/cargo-installa6UIqr/release/deps/proc_macro_hack-ab55b2d3c631ea17.proc_macro_hack.9cxz4p5v-cgu.13.rcgu.o" "/tmp/cargo-installa6UIqr/release/deps/proc_macro_hack-ab55b2d3c631ea17.proc_macro_hack.9cxz4p5v-cgu.14.rcgu.o" "/tmp/cargo-installa6UIqr/release/deps/proc_macro_hack-ab55b2d3c631ea17.proc_macro_hack.9cxz4p5v-cgu.15.rcgu.o" "/tmp/cargo-installa6UIqr/release/deps/proc_macro_hack-ab55b2d3c631ea17.proc_macro_hack.9cxz4p5v-cgu.2.rcgu.o" "/tmp/cargo-installa6UIqr/release/deps/proc_macro_hack-ab55b2d3c631ea17.proc_macro_hack.9cxz4p5v-cgu.3.rcgu.o" "/tmp/cargo-installa6UIqr/release/deps/proc_macro_hack-ab55b2d3c631ea17.proc_macro_hack.9cxz4p5v-cgu.4.rcgu.o" "/tmp/cargo-installa6UIqr/release/deps/proc_macro_hack-ab55b2d3c631ea17.proc_macro_hack.9cxz4p5v-cgu.5.rcgu.o" "/tmp/cargo-installa6UIqr/release/deps/proc_macro_hack-ab55b2d3c631ea17.proc_macro_hack.9cxz4p5v-cgu.6.rcgu.o" "/tmp/cargo-installa6UIqr/release/deps/proc_macro_hack-ab55b2d3c631ea17.proc_macro_hack.9cxz4p5v-cgu.7.rcgu.o" "/tmp/cargo-installa6UIqr/release/deps/proc_macro_hack-ab55b2d3c631ea17.proc_macro_hack.9cxz4p5v-cgu.8.rcgu.o" "/tmp/cargo-installa6UIqr/release/deps/proc_macro_hack-ab55b2d3c631ea17.proc_macro_hack.9cxz4p5v-cgu.9.rcgu.o" "-o" "/tmp/cargo-installa6UIqr/release/deps/libproc_macro_hack-ab55b2d3c631ea17.so" "/tmp/cargo-installa6UIqr/release/deps/proc_macro_hack-ab55b2d3c631ea17.7jyulojogc450ov.rcgu.o" "/tmp/cargo-installa6UIqr/release/deps/proc_macro_hack-ab55b2d3c631ea17.41tqfhqhghl5a1s1.rcgu.o" "-Wl,--gc-sections" "-shared" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/tmp/cargo-installa6UIqr/release/deps" "-L" "/usr/local/rustup/toolchains/1.48.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib" "-Wl,-Bstatic" "/usr/local/rustup/toolchains/1.48.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libproc_macro-b10c112b9cf164a3.rlib" "-Wl,--start-group" "/usr/local/rustup/toolchains/1.48.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libstd-dfa62aa5262ff4b4.rlib" "/usr/local/rustup/toolchains/1.48.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libpanic_unwind-4a6a72565ec76f3c.rlib" "/usr/local/rustup/toolchains/1.48.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libminiz_oxide-1443a9b0ae2bded0.rlib" "/usr/local/rustup/toolchains/1.48.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libadler-b19b49e034e0d1c6.rlib" "/usr/local/rustup/toolchains/1.48.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libobject-7bbe9855d65a0f57.rlib" "/usr/local/rustup/toolchains/1.48.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libaddr2line-f0c6c29a9500b8dc.rlib" "/usr/local/rustup/toolchains/1.48.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libgimli-9db52ac545ffea15.rlib" "/usr/local/rustup/toolchains/1.48.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/librustc_demangle-e03b03942fcf408f.rlib" "/usr/local/rustup/toolchains/1.48.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libhashbrown-6f857cc95b8002a2.rlib" "/usr/local/rustup/toolchains/1.48.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/librustc_std_workspace_alloc-0d1b1f18729d9c59.rlib" "/tmp/rustcMkuMJI/libunwind-5d891ffe6c98281b.rlib" "/usr/local/rustup/toolchains/1.48.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libcfg_if-d65ac5803e3ee9c5.rlib" "/tmp/rustcMkuMJI/liblibc-867c6ac18b39c347.rlib" "/usr/local/rustup/toolchains/1.48.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/liballoc-af8cb47c5dd3106d.rlib" "/usr/local/rustup/toolchains/1.48.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/librustc_std_workspace_core-c7d15be31f34d5c3.rlib" "/usr/local/rustup/toolchains/1.48.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libcore-fb7c8bd0f6fca1fa.rlib" "-Wl,--end-group" "/usr/local/rustup/toolchains/1.48.0-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/libcompiler_builtins-97cfa70fe6990c5f.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lc"
  = note: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find crti.o: No such file or directory
          collect2: error: ld returned 1 exit status


error: aborting due to previous error

error: could not compile `proc-macro-hack`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `mdbook v0.4.4`, intermediate artifacts can be found at `/tmp/cargo-installa6UIqr`

Caused by:
  build failed
```

# 解決法

```sh
$ apk add alpine-sdk
```

のあとに

```sh
$ cargo install {module}
```

## alpine-sdk とは

開発時にだいたい必要になるようなビルドツールをまとめて提供しているパッケージ
apt の `build-essential`、yum の `Developper Tools` のようなもの