-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (34 loc) · 1.21 KB
/
Dockerfile
File metadata and controls
42 lines (34 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0.
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.9.0 AS xx
FROM --platform=$BUILDPLATFORM rust:1.91.1-alpine3.22 AS builder
COPY --from=xx / /
ARG BUILDARCH
ARG TARGETARCH
ARG BUILDPLATFORM
ARG TARGETPLATFORM
RUN xx-apk add --no-cache xx-c-essentials && \
apk add --no-cache musl-dev clang perl make
# Install target for cargo and other build tools (ie: clang)
RUN xx-cargo --setup-target-triple
WORKDIR /build
COPY src ./src
COPY Cargo.toml ./
COPY Cargo.lock ./
RUN xx-cargo build --release && \
mv ./target/$(xx-cargo --print-target-triple)/release/ephemeral-storage-setup ./ && \
xx-verify --static ./ephemeral-storage-setup
FROM alpine:3.23 AS final
RUN apk add --no-cache \
lvm2 \
lsblk \
openssl
COPY lvm.conf /etc/lvm/lvm.conf
COPY --from=builder /build/ephemeral-storage-setup /usr/local/bin/
CMD ["ephemeral-storage-setup"]