-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathContainerfile
More file actions
59 lines (47 loc) · 1.78 KB
/
Containerfile
File metadata and controls
59 lines (47 loc) · 1.78 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
####
# This Containerfile is used to build the container for charon
#
# charon requires python 3
#
# 0. Step into the project dir
#
# 1. Build the image
# docker/podman build -t charon:1.0.0 -f image/Containerfile .
#
# 2. Run the container as daemon, mount the host ~/upload/ path to container /root/upload/ path,
# the uploading path is the dir location where you will upload the tarballs from
# add -e to set specific environment variables, such as: AWS_PROFILE, aws_endpoint_url, bucket
# docker/podman run -dit -v ~/upload/:/home/charon/upload/ --name charon charon:1.0.0
#
# 3. Execute the container
# docker/podman exec -it charon bash
#
# 4. Start using uploader
# charon upload/delete from /home/charon/upload/...
###
FROM registry.access.redhat.com/ubi8-minimal:8.10-1770021813 as builder
ARG GIT_BRANCH=release
RUN microdnf install -y git-core python3.12-devel python3.12-pip gcc openssl-devel && microdnf clean all
RUN git clone -b ${GIT_BRANCH} --depth 1 https://github.com/Commonjava/charon.git
RUN pip3 install --no-cache-dir --upgrade pip
RUN pip3 wheel ./charon
FROM registry.access.redhat.com/ubi8-minimal:8.10-1770021813
ARG USER=charon
ARG UID=10000
ARG HOME_DIR=/home/${USER}
WORKDIR ${HOME_DIR}
USER root
RUN microdnf install -y python3.12-devel python3.12-pip shadow-utils gcc openssl-devel && microdnf clean all
RUN useradd -d ${HOME_DIR} -u ${UID} -g 0 -m -s /bin/bash ${USER} \
&& chown ${USER}:0 ${HOME_DIR} \
&& chmod -R g+rwx ${HOME_DIR} \
&& chmod g+rw /etc/passwd
COPY --from=builder ./*.whl ./
RUN pip3 install --no-cache-dir --upgrade pip
RUN pip3 install --no-cache-dir ./*.whl
RUN rm ./*.whl
RUN microdnf remove python3.12-pip shadow-utils && microdnf clean all
USER ${USER}
ENV HOME=${HOME_DIR} \
LANG=en_US.UTF-8
CMD ["/usr/local/bin/charon"]