alpine-ansible-lint: rewrite

This commit is contained in:
Haitao Pan 2024-04-13 19:57:57 +08:00
parent ed71c5e4d1
commit c583369eef
2 changed files with 10 additions and 29 deletions

View File

@ -1,34 +1,12 @@
FROM alpine:3.18.3
LABEL maintainer="Haitao Pan <manbuzhe2009@qq.com>"
ARG GLIBC_VERSION=2.34-r0
# install glibc compatibility for alpine
RUN apk add --update --no-cache curl binutils \
&& curl -sL https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub -o /etc/apk/keys/sgerrand.rsa.pub \
&& curl -sLO https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk \
&& curl -sLO https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-bin-${GLIBC_VERSION}.apk \
&& curl -sLO https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-i18n-${GLIBC_VERSION}.apk \
&& apk add --no-cache --force-overwrite \
glibc-${GLIBC_VERSION}.apk \
glibc-bin-${GLIBC_VERSION}.apk \
glibc-i18n-${GLIBC_VERSION}.apk \
&& apk fix --force-overwrite alpine-baselayout-data \
&& /usr/glibc-compat/bin/localedef -i en_US -f UTF-8 en_US.UTF-8 \
&& rm -rf glibc-*.apk \
&& rm -rf /var/cache/apk/*
FROM alpine:latest
# Install system dependencies
RUN apk add --no-cache bash git python3 py3-pip jq \
&& pip3 install --upgrade pip \
&& pip3 install hvac jinja2 ansible ansible-lint \
&& ansible-galaxy collection install community.hashi_vault
RUN apk add --no-cache bash git python3 py3-pip jq && \
pip3 install --upgrade pip && \
pip3 install hvac jinja2 ansible ansible-lint && \
ansible-galaxy collection install community.hashi_vault
# Set work directory
WORKDIR /src
ADD entrypoint.sh /entrypoint.sh
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/bin/bash"]

View File

@ -1,5 +1,8 @@
#!/bin/sh
# required by Jenkins Docker plugin: https://github.com/docker-library/official-images#consistency
set -x
# Print a message
echo "Ansible Docker container is ready to run playbooks..."
# Execute the command passed to the Docker container
exec "$@"