A cargo-pack
er for docker; package your application into a docker image to deploy without Dockerfile
THIS PRODUCT IS ALPHA STATUS. USE AT YOUR OWN RISK
cargo install cargo-pack-docker
``` cargo pack-docker [-p package] [--release] [TAG]
[[package.metadata.pack.docker]]
section, it will be used```
``` toml
[package.metadata.pack] default-packers = ["docker"]
files = ["README.md"]
[[package.metadata.pack.docker]]
tag = "hoge:0.1.0"
base-image = "ubuntu:16.04"
bin = "aaa"
ENTRYPOINT
of Dockerfile. optional.entrypoint = ["aa", "bb"]
CMD
of Dockerfile. optional.cmd = ["c", "d"]
inject = " ENV RUST_LOG debug RUN apt install libpq-dev "
[[package.metadata.pack.docker]] base-image = "ubuntu:16.04" bin = "bbb" ```
with the first configuration, build a docker image with this Dockerfile content:
``` FROM ubuntu:16.04
RUN mkdir -p /opt/app/bin COPY README.md /opt/app COPY aaa /opt/app/bin WORKDIR /opt/app
ENV RUST_LOG debug RUN apt install libpq-dev
ENTRYPOINT ["aa", "bb"] CMD ["c", "d"]
```