-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
24 lines (17 loc) · 827 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM rust:1.62-buster
# Download docker-explorer
ARG docker_explorer_version=v18
RUN curl --fail -Lo /usr/local/bin/docker-explorer https://github.com/codecrafters-io/docker-explorer/releases/download/${docker_explorer_version}/${docker_explorer_version}_linux_amd64
RUN chmod +x /usr/local/bin/docker-explorer
# Grab the dependencies and compile them as they dont change much
COPY Cargo.toml /app/Cargo.toml
COPY Cargo.lock /app/Cargo.lock
RUN mkdir /app/src
RUN echo 'fn main() { println!("Hello World!"); }' > /app/src/main.rs
WORKDIR /app
RUN cargo build --release --target-dir=/tmp/codecrafters-docker-target
RUN cargo clean -p docker-starter-rust --release --target-dir=/tmp/codecrafters-docker-target
# Grab the real code
COPY . /app
RUN sed -i -e 's/\r$//' /app/your_docker.sh
ENTRYPOINT ["/app/your_docker.sh"]