DEV Community

Jorge Brunal Pérez
Jorge Brunal Pérez

Posted on

DockerFile para aplicaciones en Rust

publicado originalmente (2018-05-01) en mi sitio web

Creando una imagen de Docker para una aplicación en Rust.

Este archivo, se extrajo del repositorio rocket-rust facilitando la creación de una imagen de Docker para aplicaciones en Rust, usando Rocket como Web framework.

FROM ubuntu:16.04

MAINTAINER Awesome User <awesome-user@example.como>

RUN apt-get update \
    && apt-get install -y curl nano file net-tools build-essential

RUN curl https://sh.rustup.rs -s > /home/install.sh && \
    chmod +x /home/install.sh && \
    sh /home/install.sh -y --verbose --default-toolchain nightly

ENV PATH "/root/.cargo/bin:$PATH"

ENV SOURCES=/sources

RUN mkdir -p $SOURCES

ADD ./ $SOURCES

WORKDIR $SOURCES

RUN rustup update

RUN cargo update

RUN cargo build --release

EXPOSE 80
EXPOSE 8080

# CMD ROCKET_ENV=development ./target/release/rocket-rust

CMD ROCKET_ENV=production ./target/release/rocket-rust
Enter fullscreen mode Exit fullscreen mode

referencias

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more