Skip to content

Commit

Permalink
Switched to Python virtual env and installed Python 3.11 in Almalinux
Browse files Browse the repository at this point in the history
  • Loading branch information
haxorof committed Apr 1, 2024
1 parent 787e8d2 commit b09c801
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 90 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ env:
IMAGE_NAME: haxorof/ansible-core
LATEST_OS: alpine
LATEST_VERSION: v2.16
DOCKER_CLI_VERSION: "24.0.5"
GOSU_VERSION: "1.16"
DOCKER_CLI_VERSION: "25.0.5"
GOSU_VERSION: "1.17"

jobs:
build_push:
runs-on: ubuntu-latest
strategy:
matrix:
os: [alpine, ubuntu]
os: [alpine, almalinux, ubuntu]
version: [v2.14, v2.15, v2.16]
steps:
- name: Checkout
Expand Down
80 changes: 0 additions & 80 deletions .github/workflows/ci_almalinux.yml

This file was deleted.

16 changes: 10 additions & 6 deletions Dockerfile.almalinux
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM almalinux:9.3-20231124
FROM almalinux/9-base:9.3-20231124

LABEL org.opencontainers.image.title="haxorof/ansible-core" \
org.opencontainers.image.description="Ansible Core + additions" \
Expand All @@ -7,8 +7,10 @@ LABEL org.opencontainers.image.title="haxorof/ansible-core" \
ARG docker_version
ARG gosu_version

ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV VIRTUAL_ENV=/.env
ENV PATH=$VIRTUAL_ENV/bin:$PATH

ONBUILD USER root

Expand All @@ -23,7 +25,8 @@ RUN dnf install -y epel-release \
sshpass \
git \
sudo \
python3-pip \
python3.11 \
python3.11-pip \
tar \
wget \
curl-minimal \
Expand All @@ -33,8 +36,9 @@ RUN dnf install -y epel-release \
&& curl -o /usr/bin/gosu "https://github.com/tianon/gosu/releases/download/$gosu_version/gosu-amd64" \
&& chmod +x /usr/bin/gosu \
&& gosu nobody true \
&& python3 -m pip install --no-cache-dir --upgrade pip \
&& python3 -m pip install --no-cache-dir -r requirements.txt \
&& python3.11 -m venv ${VIRTUAL_ENV} \
&& python3.11 -m pip install --no-cache-dir --upgrade pip \
&& python3.11 -m pip install --no-cache-dir -r requirements.txt \
&& curl https://download.docker.com/linux/static/stable/x86_64/docker-${docker_version}.tgz | tar -xz -C /usr/lib \
&& ln -s /usr/lib/docker/docker /usr/bin/docker \
&& mkdir -p /etc/ansible/roles \
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ARG gosu_version

ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV VIRTUAL_ENV=/.env
ENV PATH=$VIRTUAL_ENV/bin:$PATH

ONBUILD USER root

Expand All @@ -29,6 +31,7 @@ RUN apk update \
&& wget -O /usr/bin/gosu "https://github.com/tianon/gosu/releases/download/$gosu_version/gosu-amd64" \
&& chmod +x /usr/bin/gosu \
&& gosu nobody true \
&& python3 -m venv ${VIRTUAL_ENV} \
&& python3 -m pip install --no-cache-dir --upgrade pip \
&& python3 -m pip install --no-cache-dir -r requirements.txt \
&& wget -O - https://download.docker.com/linux/static/stable/x86_64/docker-${docker_version}.tgz | tar -xz -C /usr/lib \
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ARG gosu_version

ENV DEBIAN_FRONTEND=noninteractive
ENV DEFAULT_LOCAL_TMP=/var/tmp/.ansible/tmp
ENV VIRTUAL_ENV=/.env
ENV PATH=$VIRTUAL_ENV/bin:$PATH

ONBUILD USER root

Expand All @@ -23,6 +25,7 @@ RUN apt-get clean \
git \
sudo \
python3-pip \
python3-venv \
wget \
curl \
tzdata \
Expand All @@ -31,6 +34,7 @@ RUN apt-get clean \
&& wget -O /usr/bin/gosu "https://github.com/tianon/gosu/releases/download/$gosu_version/gosu-amd64" \
&& chmod +x /usr/bin/gosu \
&& gosu nobody true \
&& python3 -m venv ${VIRTUAL_ENV} \
&& python3 -m pip install --no-cache-dir --break-system-packages --upgrade pip \
&& python3 -m pip install --no-cache-dir --break-system-packages -r requirements.txt \
&& wget -O - https://download.docker.com/linux/static/stable/x86_64/docker-${docker_version}.tgz | tar -xz -C /usr/lib \
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This repos stop supporting versions as it gets EOL according to [Ansible - Relea

## Simple Tags

- `v2.16-almalinux`
- `v2.16-alpine`
- `v2.16-ubuntu`
- `v2.15-almalinux`
Expand All @@ -33,7 +34,7 @@ This repos stop supporting versions as it gets EOL according to [Ansible - Relea
- `v2.14`
- `v2.14-alpine`
- `latest-almalinux`
- `v2.15-almalinux`
- `v2.16-almalinux`
- `latest-ubuntu`
- `v2.16-ubuntu`

Expand Down

0 comments on commit b09c801

Please sign in to comment.