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 ad7267d commit 8501149
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
os: [alpine]
os: [alpine, almalinux]
version: [v5, v6, v24]
steps:
- name: Checkout
Expand Down
88 changes: 0 additions & 88 deletions .github/workflows/ci_almalinux.yml

This file was deleted.

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

LABEL org.opencontainers.image.title="haxorof/ansible-lint" \
org.opencontainers.image.description="Ansible-lint"

ENV VIRTUAL_ENV=/.env
ENV PATH=$VIRTUAL_ENV/bin:$PATH

COPY requirements/requirements.txt ./requirements.txt

RUN dnf install -y epel-release \
Expand All @@ -12,9 +15,11 @@ RUN dnf install -y epel-release \
&& dnf install -y \
openssh \
git \
python3-pip \
&& python3 -m pip install --no-cache-dir --upgrade pip \
&& python3 -m pip install --no-cache-dir -r requirements.txt \
python3.11 \
python3.11-pip \
&& 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 \
&& dnf clean all \
&& rm -rf /var/cache/yum

Expand Down
4 changes: 4 additions & 0 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ FROM python:3.12.2-alpine
LABEL org.opencontainers.image.title="haxorof/ansible-lint" \
org.opencontainers.image.description="Ansible-lint"

ENV VIRTUAL_ENV=/.env
ENV PATH=$VIRTUAL_ENV/bin:$PATH

COPY requirements/requirements.txt ./requirements.txt

RUN apk add --no-cache linux-headers \
Expand All @@ -12,6 +15,7 @@ RUN apk add --no-cache linux-headers \
git \
openssh \
cargo \
&& python3 -m venv ${VIRTUAL_ENV} \
&& python3 -m pip install --no-cache-dir --upgrade pip \
&& python3 -m pip install --no-cache-dir -r requirements.txt \
&& rm -rf /var/cache/apk/* \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- `v5`
- `v5-alpine`
- `latest-almalinux`
- `v6-almalinux`
- `v24-almalinux`

## How to use this image

Expand Down
1 change: 1 addition & 0 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ansible-lint==v24.2.1

0 comments on commit 8501149

Please sign in to comment.