/
wax_boy
/
semaphore_custom
Обзор
Документация
Войти
/
wax_boy
/
semaphore_custom
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
deployment/docker/runner/Dockerfile
107 строк
4 KB
Denis Gukov
fix: branch and use correct function
28 июл 2026, 12:46
28 июл 2026, 12:46
9bea2a6
Код
Авторство
О чём код?
FROM --platform=$BUILDPLATFORM golang:1.26-alpine3.24 as builder RUN apk add --no-cache -U \ libc-dev curl nodejs npm git gcc zip unzip tar WORKDIR /usr/local # hadolint ignore=DL4006 RUN curl -sL https://taskfile.dev/install.sh | sh WORKDIR /go/src/semaphore COPY . /go/src/semaphore RUN --mount=type=cache,target=/go/pkg \ go mod download -x ARG APP_BUILD_TYPE ARG TARGETOS ARG TARGETARCH ARG GH_TOKEN RUN if [ -n "$APP_BUILD_TYPE" ]; then \ git clone -b main https://${GH_TOKEN}@github.com/semaphoreui/semaphorepro-module.git pro_impl && \ go work init . ./pro_impl; \ fi RUN --mount=type=cache,target=/go/pkg \ --mount=type=cache,target=/root/.cache/go-build \ task deps APP_BUILD_TYPE=${APP_BUILD_TYPE} && \ task build GOOS=${TARGETOS} GOARCH=${TARGETARCH} APP_BUILD_TYPE=${APP_BUILD_TYPE} # renovate: datasource=github-releases depName=opentofu/opentofu ENV OPENTOFU_VERSION=1.11.0 # renovate: datasource=github-releases depName=hashicorp/terraform ENV TERRAFORM_VERSION=1.11.3 # renovate: datasource=github-releases depName=gruntwork-io/terragrunt ENV TERRAGRUNT_VERSION=0.78.0 #ENV PULUMI_VERSION="3.116.1" RUN wget https://github.com/opentofu/opentofu/releases/download/v${OPENTOFU_VERSION}/tofu_${OPENTOFU_VERSION}_linux_${TARGETARCH}.tar.gz && \ tar xf tofu_${OPENTOFU_VERSION}_linux_${TARGETARCH}.tar.gz -C /tmp && \ rm tofu_${OPENTOFU_VERSION}_linux_${TARGETARCH}.tar.gz RUN curl -O https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip && \ unzip terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip -d /tmp && \ rm terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip RUN wget -O /tmp/terragrunt https://github.com/gruntwork-io/terragrunt/releases/download/v${TERRAGRUNT_VERSION}/terragrunt_linux_${TARGETARCH} && \ chmod +x /tmp/terragrunt FROM alpine:3.24 ARG TARGETARCH="amd64" RUN apk add --no-cache -U \ bash curl git gnupg mysql-client openssh-client-default python3 python3-dev py3-pip rsync sshpass tar tini tzdata unzip wget zip && \ rm -rf /var/cache/apk/* && \ adduser -D -u 1001 -G root semaphore && \ mkdir -p /tmp/semaphore && \ mkdir -p /etc/semaphore && \ mkdir -p /var/lib/semaphore && \ mkdir -p /opt/semaphore && \ chown -R semaphore:0 /tmp/semaphore && \ chown -R semaphore:0 /etc/semaphore && \ chown -R semaphore:0 /var/lib/semaphore && \ chown -R semaphore:0 /opt/semaphore && \ find /usr/lib/python* -iname __pycache__ | xargs rm -rf COPY --chown=1001:0 ./deployment/docker/runner/ansible.cfg /etc/ansible/ansible.cfg COPY --from=builder /go/src/semaphore/deployment/docker/runner/runner-wrapper /usr/local/bin/ COPY --from=builder /go/src/semaphore/bin/semaphore /usr/local/bin/ COPY --from=builder /tmp/tofu /usr/local/bin/ COPY --from=builder /tmp/terraform /usr/local/bin/ COPY --from=builder /tmp/terragrunt /usr/local/bin/ RUN chown -R semaphore:0 /usr/local/bin/runner-wrapper && \ chmod +x /usr/local/bin/runner-wrapper && \ chown -R semaphore:0 /usr/local/bin/semaphore && \ chmod +x /usr/local/bin/semaphore WORKDIR /home/semaphore # renovate: datasource=pypi depName=ansible ARG ANSIBLE_VERSION=13.5.0 ENV ANSIBLE_VERSION=${ANSIBLE_VERSION} ARG ANSIBLE_VENV_PATH=/opt/semaphore/apps/ansible/${ANSIBLE_VERSION}/venv RUN apk add --no-cache -U python3-dev build-base openssl-dev libffi-dev cargo && \ mkdir -p ${ANSIBLE_VENV_PATH} && \ python3 -m venv ${ANSIBLE_VENV_PATH} --system-site-packages && \ source ${ANSIBLE_VENV_PATH}/bin/activate && \ pip3 install --upgrade pip ansible==${ANSIBLE_VERSION} boto3 botocore requests pywinrm passlib && \ apk del python3-dev build-base openssl-dev libffi-dev cargo && \ rm -rf /var/cache/apk/* && \ find ${ANSIBLE_VENV_PATH} -iname __pycache__ | xargs rm -rf && \ chown -R semaphore:0 /opt/semaphore RUN echo 'Host *\n StrictHostKeyChecking no\n UserKnownHostsFile /dev/null' > /etc/ssh/ssh_config.d/semaphore.conf USER 1001 ENV VIRTUAL_ENV="$ANSIBLE_VENV_PATH" ENV PATH="$ANSIBLE_VENV_PATH/bin:$PATH" # Preventing ansible zombie processes. Tini kills zombies. ENTRYPOINT ["/sbin/tini", "--"] CMD [ "/usr/local/bin/runner-wrapper"]