-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.amd64
More file actions
24 lines (16 loc) · 883 Bytes
/
Dockerfile.amd64
File metadata and controls
24 lines (16 loc) · 883 Bytes
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 --platform=$TARGETPLATFORM rust:slim as build
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "Building on $BUILDPLATFORM for $TARGETPLATFORM"
RUN rustup target add x86_64-unknown-linux-gnu
WORKDIR /usr/src/airbyte-replication-operator
COPY . .
ENV RUSTFLAGS='-C target-feature=+crt-static'
RUN --mount=type=cache,target=/usr/local/cargo/registry,id=${TARGETPLATFORM} \
--mount=type=cache,target=/usr/src/airbyte-replication-operator/target,id=${TARGETPLATFORM} \
cargo install --bins --path . --target x86_64-unknown-linux-gnu
FROM --platform=$TARGETPLATFORM gcr.io/distroless/cc-debian11
COPY --from=build /usr/local/cargo/bin/airbyte-replication-driver /usr/local/bin/airbyte-replication-driver
COPY --from=build /usr/local/cargo/bin/airbyte-replication-operator /usr/local/bin/airbyte-replication-operator
USER 65532:65532
CMD ["airbyte-replication-operator"]