-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile
108 lines (88 loc) · 4.3 KB
/
Containerfile
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
FROM rust:latest AS builder
# Required for building starship
RUN --mount=type=cache,target=/var/cache/apt \
apt update && apt install -y cmake
COPY rusty-crates /rusty-crates
RUN \
--mount=type=cache,target=${CARGO_HOME}/git \
--mount=type=cache,target=${CARGO_HOME}/registry \
cargo install --locked $(cat rusty-crates)
RUN rm /rusty-crates
# --- Fedora ---
FROM registry.fedoraproject.org/fedora-toolbox:41 AS fedora-oxidized.toolbox
ARG NAME=fedora-oxidized.toolbox
ARG VERSION=41
ARG USAGE="This image is meant to be used with the toolbx or distrobox command"
ARG SUMMARY="Rusted image based on Fedora Toolbox base container"
LABEL com.github.containers.toolbox="true" \
com.redhat.component="$NAME" \
name="$NAME" \
version="$VERSION" \
usage="$USAGE" \
summary="$SUMMARY" \
maintainer="nain <[email protected]>"
LABEL org.opencontainers.image.description="${SUMMARY}. ${USAGE}"
# Pull in useful rust tools
## https://doc.rust-lang.org/stable/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
## If you wish to cache binaries installed with cargo install, you need to cache the bin/ folder and the .crates.toml and .crates2.json files.
COPY --from=builder /usr/local/cargo/bin/ /opt/rusty-pets/cargo/bin/
COPY --from=builder /usr/local/cargo/.crates.toml /usr/local/cargo/.crates2.json /opt/cargo/
ENV PATH=/opt/cargo/bin:$PATH
COPY customization/common/files/ /
COPY customization/rusty-fedora/files/ /
COPY customization/common/build-scripts/ /build-scripts/
COPY customization/rusty-fedora/build-scripts/ /build-scripts/
RUN for i in /build-scripts/*; do if [ -r $i ]; then . $i; fi; done
RUN rm -r /build-scripts
# --- Ubuntu ---
FROM quay.io/toolbx/ubuntu-toolbox:24.04 AS ubuntu-oxidized.toolbox
ARG NAME=ubuntu-oxidized.toolbox
ARG VERSION=24.04
ARG USAGE="This image is meant to be used with the toolbx or distrobox command"
ARG SUMMARY="Rusted image based on Ubuntu Toolbox base container"
LABEL com.github.containers.toolbox="true" \
com.redhat.component="$NAME" \
name="$NAME" \
version="$VERSION" \
usage="$USAGE" \
summary="$SUMMARY" \
maintainer="nain <[email protected]>"
LABEL org.opencontainers.image.description="${SUMMARY}. ${USAGE}"
# Pull in useful rust tools
## https://doc.rust-lang.org/stable/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
## If you wish to cache binaries installed with cargo install, you need to cache the bin/ folder and the .crates.toml and .crates2.json files.
COPY --from=builder /usr/local/cargo/bin/ /opt/rusty-pets/cargo/bin/
COPY --from=builder /usr/local/cargo/.crates.toml /usr/local/cargo/.crates2.json /opt/cargo/
ENV PATH=/opt/cargo/bin:$PATH
COPY customization/common/files/ /
COPY customization/rusty-ubuntu/files/ /
COPY customization/common/build-scripts/ /build-scripts/
COPY customization/rusty-ubuntu/build-scripts/ /build-scripts/
RUN for i in /build-scripts/*; do if [ -r $i ]; then . $i; fi; done
RUN rm -r /build-scripts
# --- Arch ---
FROM quay.io/toolbx/arch-toolbox:latest AS arch-oxidized.toolbox
ARG NAME=arch-oxidized.toolbox
ARG VERSION=latest
ARG USAGE="This image is meant to be used with the toolbx or distrobox command"
ARG SUMMARY="Rusted image based on Arch Toolbox base container"
LABEL com.github.containers.toolbox="true" \
com.redhat.component="$NAME" \
name="$NAME" \
version="$VERSION" \
usage="$USAGE" \
summary="$SUMMARY" \
maintainer="nain <[email protected]>"
LABEL org.opencontainers.image.description="${SUMMARY}. ${USAGE}"
# Pull in useful rust tools
## https://doc.rust-lang.org/stable/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
## If you wish to cache binaries installed with cargo install, you need to cache the bin/ folder and the .crates.toml and .crates2.json files.
COPY --from=builder /usr/local/cargo/bin/ /opt/rusty-pets/cargo/bin/
COPY --from=builder /usr/local/cargo/.crates.toml /usr/local/cargo/.crates2.json /opt/cargo/
ENV PATH=/opt/cargo/bin:$PATH
COPY customization/common/files/ /
COPY customization/rusty-arch/files/ /
COPY customization/common/build-scripts/ /build-scripts/
COPY customization/rusty-arch/build-scripts/ /build-scripts/
RUN for i in /build-scripts/*; do if [ -r $i ]; then . $i; fi; done
RUN rm -r /build-scripts