mirror of
https://codeberg.org/icewind/docker-hub-rss.git
synced 2026-06-03 10:14:07 +02:00
dockerfile
This commit is contained in:
parent
dc07e0ed7c
commit
919e6bbeef
2 changed files with 24 additions and 0 deletions
2
.dockerignore
Normal file
2
.dockerignore
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
target
|
||||
.env
|
||||
22
Dockerfile
Normal file
22
Dockerfile
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
FROM ekidd/rust-musl-builder AS build
|
||||
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
|
||||
# Build with a dummy main to pre-build dependencies
|
||||
RUN mkdir src && \
|
||||
sudo chown -R rust:rust . && \
|
||||
echo "fn main(){}" > src/main.rs && \
|
||||
cargo build --release && \
|
||||
rm -r src
|
||||
|
||||
COPY src/ ./src/
|
||||
RUN sudo chown -R rust:rust . && touch src/main.rs
|
||||
|
||||
RUN cargo build --release
|
||||
|
||||
FROM scratch
|
||||
|
||||
COPY --from=build /home/rust/src/target/x86_64-unknown-linux-musl/release/docker-hub-rss /
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["/docker-hub-rss"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue