Skip to content
Dockerfile 1.27 KiB
Newer Older
Дмитрий Сафронов's avatar
Дмитрий Сафронов committed
FROM registry.cyberbrain.pw/docker/alpine:latest AS builder
Дмитрий Сафронов's avatar
Дмитрий Сафронов committed
ENV PATH="/opt/ansible/bin:$PATH"
RUN apk --no-cache add python3 && \
    apk --no-cache add --virtual build-dependencies \
        musl-dev \
        python3-dev \
        libffi-dev \
        openssl-dev \
        cargo \
        && \
    python3 -m venv /opt/ansible && \
    pip3 install --ignore-installed --no-cache-dir --upgrade \
        pip \
        setuptools \
        wheel \
        && \
    ( test -z $ANSIBLE_VERSION && \
        pip install --ignore-installed --no-cache-dir ansible || \
        pip install --ignore-installed --no-cache-dir ansible\<=$ANSIBLE_VERSION \
        ) && \
Дмитрий Сафронов's avatar
Дмитрий Сафронов committed
    pip3 install --ignore-installed --no-cache-dir \
        ansible-lint \
        mitogen \
        jmespath \
        pywinrm \
Дмитрий Сафронов's avatar
Дмитрий Сафронов committed
        && \
    #apk del build-dependencies && \
Дмитрий Сафронов's avatar
Дмитрий Сафронов committed
    rm -rf /var/cache/apk/*
Дмитрий Сафронов's avatar
Дмитрий Сафронов committed
FROM registry.cyberbrain.pw/docker/alpine:latest AS runtime
ENV PATH="/opt/ansible/bin:$PATH"
WORKDIR /srv/ansible
RUN apk --no-cache add \
        python3 \
        openssl \
        ca-certificates \
        sshpass \
        openssh-client \
        rsync \
        git \
        && \
    rm -rf /var/cache/apk/*
Дмитрий Сафронов's avatar
Дмитрий Сафронов committed
COPY --from=builder /opt/ansible /opt/ansible
CMD [ "ansible", "--version" ]