mirror of
https://github.com/Noratrieb/killjoy-turret.git
synced 2026-01-14 06:35:01 +01:00
dockering around
This commit is contained in:
parent
d5c4f1b213
commit
a75e02e7d9
4 changed files with 13 additions and 12 deletions
|
|
@ -1 +1,3 @@
|
|||
target/
|
||||
target/
|
||||
.idea/
|
||||
config.json
|
||||
13
Dockerfile
13
Dockerfile
|
|
@ -2,24 +2,29 @@ FROM rust as build
|
|||
|
||||
RUN rustup toolchain install nightly
|
||||
RUN rustup default nightly
|
||||
RUN rustup target add x86_64-unknown-linux-musl
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install musl-tools -y
|
||||
|
||||
WORKDIR /app
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
RUN mkdir src
|
||||
RUN echo "fn main() {}" > src/main.rs
|
||||
|
||||
RUN cargo build --release -Zsparse-registry
|
||||
RUN cargo build --release -Zsparse-registry --target x86_64-unknown-linux-musl
|
||||
|
||||
COPY src ./src
|
||||
|
||||
# now rebuild with the proper main
|
||||
RUN touch src/main.rs
|
||||
RUN cargo build --release -Zsparse-registry
|
||||
RUN cargo build --release -Zsparse-registry --target x86_64-unknown-linux-musl
|
||||
|
||||
FROM debian:latest
|
||||
### RUN
|
||||
FROM scratch
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build /app/target/release/killjoy_turret killjoy_turret
|
||||
COPY --from=build /app/target/x86_64-unknown-linux-musl/release/killjoy_turret killjoy_turret
|
||||
|
||||
CMD ["/app/killjoy_turret"]
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
while true ;
|
||||
do
|
||||
/usr/local/bin/killjoy_turret
|
||||
sleep 10
|
||||
done
|
||||
1
run.sh
Executable file
1
run.sh
Executable file
|
|
@ -0,0 +1 @@
|
|||
docker run -d -v (pwd)/config.json:/app/config.json -e CONFIG_PATH=/app/config.json killjoy-turret:1.0
|
||||
Loading…
Add table
Add a link
Reference in a new issue