-
Notifications
You must be signed in to change notification settings - Fork 294
/
Copy pathContainerfile
49 lines (38 loc) · 1.12 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
# ____ _ _ _
# | __ ) _ _(_) | __| | ___ _ __
# | _ \| | | | | |/ _` |/ _ \ '__|
# | |_) | |_| | | | (_| | __/ |
# |____/ \__,_|_|_|\__,_|\___|_|
#
FROM registry.access.redhat.com/ubi9/toolbox:9.2 as builder
# This will be used in ubi-micro
RUN dnf --installroot=/tmp/ubi-micro \
--nodocs --setopt=install_weak_deps=False \
install -y \
g++ shadow-utils && \
dnf --installroot=/tmp/ubi-micro \
clean all
# This is needed to build pict
RUN dnf install -y cmake g++ && \
mkdir /tmp/pict
# Copy repo resources
COPY ./ /tmp/pict/
# Build the pict
RUN cd /tmp/pict/ && \
rm -rf build && \
cmake -DCMAKE_BUILD_TYPE=Release -S . -B build && \
cmake --build build && \
cp build/cli/pict /tmp/ubi-micro/usr/local/bin/
# __ __ _
# | \/ | __ _(_)_ __
# | |\/| |/ _` | | '_ \
# | | | | (_| | | | | |
# |_| |_|\__,_|_|_| |_|
#
FROM registry.access.redhat.com/ubi9/ubi-micro:9.2
COPY --from=builder /tmp/ubi-micro/ /
VOLUME /var/pict
WORKDIR /var/pict
RUN useradd -M pict
USER pict
ENTRYPOINT ["pict"]