-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebug.Dockerfile
44 lines (33 loc) · 1.18 KB
/
debug.Dockerfile
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
# Base image from https://repo1.dso.mil/platform-one/distros/red-hat/ocp4/openshift4-mirror/-/blob/main/Dockerfile,
# updated to use golang not python. Also added support for different archs
FROM registry.access.redhat.com/ubi8/ubi:latest
ARG arch="amd64"
ENV arch=${arch}
ENV PYCURL_SSL_LIBRARY=openssl
ENV LC_CTYPE=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
LABEL \
name="openshift4-mirror-go" \
description="Utility for mirroring OpenShift 4 content" \
maintainer="shanedell"
USER root
RUN \
yum install -y \
wget \
vim \
which \
make \
&& yum clean all \
&& wget https://go.dev/dl/go1.19.8.linux-${arch}.tar.gz \
&& tar -xzf go*.linux-${arch}.tar.gz -C /usr/local \
&& rm -rf go*.linux-${arch}.tar.gz \
&& echo 'export PATH=/usr/local/go/bin:$PATH' >> /root/.bashrc \
&& echo 'export PS1="\n\[\e[34m\]\u\[\e[m\] at \[\e[32m\]\h\[\e[m\] in \[\e[33m\]\w\[\e[m\] \[\e[31m\]\n\\$\[\e[m\] "' >> /root/.bashrc \
&& mkdir -p /app/app
COPY . /app
# Install Golang dependencies and build executable
WORKDIR /app
ENV PATH=$PATH:/usr/local/go/bin
RUN go build -o openshift_mirror .
ENTRYPOINT ["/app/entrypoint.sh"]