Skip to content

Commit

Permalink
Fix the dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
sebt3 committed May 6, 2024
1 parent e938357 commit 20324da
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ schemars = { version = "0.8.11", features = ["chrono"] }
k8s-openapi = { version = "0.21.0", features = ["latest"], default-features = false }
tokio = { version = "1.23.0", features = ["macros", "rt-multi-thread"] }
chrono = "0.4.24"
json-patch = {version = "=1.2.0"}

[dependencies.kube]
features = ["runtime", "client", "derive"]
Expand Down
1 change: 1 addition & 0 deletions agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ARG DEBIAN_VERSION=bookworm
FROM rust:${RUST_VERSION}-slim-${DEBIAN_VERSION} as builder
ARG BUILD_DEPS="binutils libssl-dev pkg-config git"
WORKDIR /usr/src/agent
COPY Cargo.lock .
# hadolint ignore=DL3008,DL3015
RUN mkdir -p package/src k8s/src agent/src \
&& echo 'fn main() { println!("Dummy") }' > agent/src/main.rs \
Expand Down
2 changes: 1 addition & 1 deletion dist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ regex = "1.7.3"
serde_json = "1.0.95"
handlebars = "4.3.6"
tokio = { version = "1.23.0", features = ["macros", "rt-multi-thread"] }

json-patch = {version = "=1.2.0"}
[[bin]]
doc = false
name = "dist"
Expand Down
11 changes: 7 additions & 4 deletions dist/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
ARG RUST_VERSION=1.77
ARG RUST_VERSION=1.77.1
ARG DEBIAN_VERSION=bookworm
FROM rust:${RUST_VERSION}-slim-${DEBIAN_VERSION} as builder
ARG BUILD_DEPS="git"
WORKDIR /usr/src/dist
COPY Cargo.lock .
COPY dist/parent.toml ./Cargo.toml
COPY src src/
COPY package/Cargo.toml package/Cargo.toml
COPY k8s/Cargo.toml k8s/Cargo.toml
COPY dist/Cargo.toml dist/Cargo.toml
# Build the deps for caching purpose
# hadolint ignore=DL3008,DL3015
RUN mkdir -p package/src dist/src \
RUN mkdir -p package/src k8s/src dist/src \
&& echo 'fn main() { println!("Dummy") }' > dist/src/main.rs \
&& touch package/src/lib.rs \
&& touch package/src/lib.rs k8s/src/lib.rs \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install ${BUILD_DEPS} \
&& CARGO_NET_GIT_FETCH_WITH_CLI=true cargo build -r --bin dist
# Get our sources
COPY package package/
COPY k8s k8s/
COPY dist dist/
# Update the crates entrypoints so cargo is aware these should rebuild
RUN touch package/src/lib.rs dist/src/main.rs \
RUN touch package/src/lib.rs k8s/src/lib.rs dist/src/main.rs \
&& cargo build -r --bin dist \
&& strip target/release/dist

Expand Down
1 change: 1 addition & 0 deletions operator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ thiserror = "1.0.37"
async-trait = "0.1.68"
either = "1.8.1"
base64 = "0.21.2"
json-patch = {version = "=1.2.0"}

[dependencies.kube]
features = ["runtime", "client", "derive"]
Expand Down
1 change: 1 addition & 0 deletions operator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ARG DEBIAN_VERSION=bookworm
FROM rust:${RUST_VERSION}-slim-${DEBIAN_VERSION} as builder
ARG BUILD_DEPS="binutils libssl-dev pkg-config git"
WORKDIR /usr/src/operator
COPY Cargo.lock .
# hadolint ignore=DL3008,DL3015
RUN mkdir -p k8s/src operator/src package/src \
&& echo 'fn main() { println!("Dummy") }' > operator/src/main.rs \
Expand Down

0 comments on commit 20324da

Please sign in to comment.