Skip to content

Commit c100b64

Browse files
committed
fix: branch name and cargo init
1 parent 73b2ca9 commit c100b64

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

.github/workflows/ghcr-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: Create and publish Docker image to GHCR
55
on:
66
workflow_dispatch:
77
push:
8-
branches: ['master']
8+
branches: ['main']
99

1010
jobs:
1111
build-and-push-image:

Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# Build Stage
22
FROM rust:slim-bullseye AS builder
3-
WORKDIR /build
3+
WORKDIR /builder
44

5+
RUN cargo init
56
# Compile deps in a separate layer (for caching)
67
COPY Cargo.toml Cargo.lock ./
7-
# Cargo requires at least one source file for compiling dependencies
8-
RUN mkdir src && echo "fn main() { println!(\"Hello, world!\"); }" > src/main.rs
98
RUN apt-get update
109
RUN apt install -y pkg-config libssl-dev
1110
RUN cargo build --release
@@ -18,5 +17,5 @@ RUN cargo build --release
1817

1918
# Release Stage
2019
FROM debian:bullseye-slim AS release
21-
COPY --from=builder /build/target/release/root /usr/local/bin
20+
COPY --from=builder /builder/target/release/root /usr/local/bin
2221
CMD ["/usr/local/bin/root"]

0 commit comments

Comments
 (0)