Skip to content

Commit

Permalink
Update Dockerfile.ubi8
Browse files Browse the repository at this point in the history
Add working ubi8 Dockerfile
  • Loading branch information
cicigee authored Nov 7, 2022
1 parent 794c71c commit a45804b
Showing 1 changed file with 28 additions and 27 deletions.
55 changes: 28 additions & 27 deletions Dockerfile.ubi8
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
# Builder (Donor) image Centos8
FROM docker.io/library/centos:8 as rpm

# Build from UBI8
FROM registry.access.redhat.com/ubi8/ubi:latest
# Build from UBI8-python39
FROM registry.access.redhat.com/ubi8/python-39:latest

# Ansible Runner Version
ARG ANSIBLE_RUNNER_VERSION="1.4.6"
ARG SERVICE_DIR="/root/ansible-runner-service"

# RPM package list
ARG RPM_PKGS="\
bash wget unzip nginx supervisor python3-psutil \
python3-pexpect python3-daemon bubblewrap gcc \
bzip2 openssh openssh-clients python2-psutil \
python3 python3-devel python3-setuptools \
glibc-locale-source glibc-langpack-en \
"
USER root

# Pip package list
ARG PIP_PKGS="\
ansible cryptography docutils psutil PyYAML \
pyOpenSSL flask flask-restful uwsgi netaddr notario \
"

# Load CentOS rpm repos
COPY --from=rpm /etc/pki /etc/pki
COPY --from=rpm /etc/os-release /etc/os-release
COPY --from=rpm /etc/yum.repos.d /etc/yum.repos.d
COPY --from=rpm /etc/redhat-release /etc/redhat-release
ARG RPM_PKGS="\
bash wget unzip nginx supervisor \
python3-daemon gcc \
bzip2 openssh openssh-clients python2-psutil \
python3 python3-devel python3-setuptools \
glibc-locale-source glibc-langpack-en \
"

# DNF Install Dependencies
RUN set -ex \
&& sed -i 's/enabled=1/enabled=0/g' /etc/yum/pluginconf.d/subscription-manager.conf \
&& dnf update -y -q \
&& dnf install -y -q epel-release \
&& dnf install -y -q ${RPM_PKGS} \
&& dnf clean all \
&& rm -rf /var/cache/yum \
&& echo
# Create CA certificate folder
RUN mkdir -p /etc/ansible-runner-service/certs/server

# Create self-signed CA
RUN openssl req -new -newkey rsa:4096 -days 3650 -nodes -x509 -subj "/C=UT/ST=UT/L=Utopia/O=Acme/CN=ansible-runner" -keyout /etc/ansible-runner-service/certs/server/server.key -out /etc/ansible-runner-service/certs/server/server.crt && \
cp /etc/ansible-runner-service/certs/server/server.crt /etc/ansible-runner-service/certs/server/ca.crt

# Install EPEL for rhel8
RUN rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

# Install RPMs
RUN dnf -y install ${RPM_PKGS}

RUN /usr/bin/python3 -m pip install --upgrade pip

# Install setuptools-rust, as this is missing
RUN /usr/bin/python3 -m pip install setuptools-rust

# PIP Install Dependencies
RUN set -ex \
Expand Down

1 comment on commit a45804b

@sebastian-philipp
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any plans to contribute to upstream? Relates to ansible#107

Please sign in to comment.