-
Notifications
You must be signed in to change notification settings - Fork 2
/
Containerfile.conan
111 lines (101 loc) · 3.53 KB
/
Containerfile.conan
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
109
110
111
ARG GO_VERSION=1.22
# Switch back to Red Hat go-toolset when it supports go 1.22
#FROM registry.access.redhat.com/ubi8/go-toolset:latest AS builder
FROM docker.io/golang:${GO_VERSION}-bullseye as builder
WORKDIR /sandbox/
COPY ./ ./
RUN make sandbox-list
FROM registry.access.redhat.com/ubi8/ubi:latest
MAINTAINER Guillaume Coré <[email protected]>
ARG AWSNUKE_VERSION=v3.26.0
ARG AWSNUKE_LEGACY_VERSION=v2.25.0
ARG RUSH_VERSION=v0.5.4
USER root
COPY --from=builder /sandbox/build/sandbox-list /usr/local/bin/sandbox-list
COPY conan/requirements.txt /tmp/requirements.txt
COPY conan/requirements.yml /tmp/requirements.yml
RUN mkdir -p -m 770 /home/opentlc-mgr/pool_management/output_dir_sandbox \
&& chmod -R 770 /home/opentlc-mgr \
&& chown -R ${USER_UID}:0 /home/opentlc-mgr \
# Packages
&& dnf install -y \
bash \
bind-utils \
curl \
findutils \
gcc \
git \
jq \
krb5-devel \
krb5-libs \
krb5-workstation \
libcurl-devel \
libxml2-devel \
nc \
net-tools \
openssl \
openssl-devel \
python39 \
python39-devel \
python39-pip \
rsync \
sshpass \
tar \
unzip \
vim \
wget \
##############################
# aws-nuke
##############################
&& curl --silent --location \
https://github.com/ekristen/aws-nuke/releases/download/${AWSNUKE_VERSION}/aws-nuke-${AWSNUKE_VERSION}-linux-amd64.tar.gz \
| tar -xz -C /usr/local/bin --wildcards 'aws-nuke' \
&& curl --silent --location \
https://github.com/rebuy-de/aws-nuke/releases/download/${AWSNUKE_LEGACY_VERSION}/aws-nuke-${AWSNUKE_LEGACY_VERSION}-linux-amd64.tar.gz \
| tar -xz -C /usr/local/bin --wildcards 'aws-nuke-*-linux-amd64' \
&& ln -s /usr/local/bin/aws-nuke-${AWSNUKE_LEGACY_VERSION}-linux-amd64 /usr/local/bin/aws-nuke-legacy \
##############################
# Rush
##############################
&& curl --silent --location \
https://github.com/shenwei356/rush/releases/download/${RUSH_VERSION}/rush_linux_amd64.tar.gz \
| tar -xz -C /usr/local/bin --wildcards 'rush' \
##############################
# AWSCLIv2
##############################
&& curl --silent --location \
https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o /tmp/awscliv2.zip \
&& unzip -q /tmp/awscliv2.zip -d /home/opentlc-mgr/pool_management \
&& /home/opentlc-mgr/pool_management/aws/install \
&& rm -rf /tmp/awscliv2.zip \
&& aws --version \
##############################
# Python
##############################
&& alternatives --set python /usr/bin/python3.9 \
&& alternatives --set python3 /usr/bin/python3.9 \
&& alternatives --install /usr/bin/pip pip /usr/bin/pip3.9 1 \
&& alternatives --list \
##############################
# Python and Ansible Galaxy collections
##############################
&& pip install --upgrade pip --no-cache-dir \
&& pip install --no-cache-dir -r /tmp/requirements.txt \
&& pip freeze \
&& ansible-galaxy collection install -vv \
-p /usr/share/ansible/collections \
-r /tmp/requirements.yml \
##############################
# Cleanup
##############################
&& dnf clean all && rm -rf /tmp/*
USER ${USER_UID}
ENV HOME=/home/opentlc-mgr
COPY . /home/opentlc-mgr/pool_management/sandbox
WORKDIR /home/opentlc-mgr/pool_management
CMD ["/home/opentlc-mgr/pool_management/sandbox/conan/conan.sh"]
ENV DESCRIPTION="Conan daemon - Cleanup of sandboxes"
LABEL name="rhpds/sandbox-conan" \
maintainer="Red Hat Demo Platform" \
description="${DESCRIPTION}" \
summary="${DESCRIPTION}"