Skip to content

Commit

Permalink
do not repull roles on docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
aine-etke committed Sep 11, 2024
1 parent 2fb4d52 commit 6a9e101
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches: [ "main", "fresh" ]
env:
agru: "v0.1.12"
alpine: "3.20"
ansible: "10.4.0"
ansible_core: "2.17.4"
Expand Down Expand Up @@ -42,7 +41,6 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
AGRU=${{ env.agru }}
ALPINE=${{ env.alpine }}
ANSIBLE=${{ env.ansible }}
ANSIBLE_CORE=${{ env.ansible_core }}
Expand Down Expand Up @@ -80,7 +78,6 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
AGRU=${{ env.agru }}
ALPINE=${{ env.alpine }}
ANSIBLE=${{ env.ansible }}
ANSIBLE_CORE=${{ env.ansible_core }}
Expand Down Expand Up @@ -139,7 +136,6 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
AGRU=${{ env.agru }}
ALPINE=${{ env.alpine }}
ANSIBLE=${{ env.ansible }}
ANSIBLE_CORE=${{ env.ansible_core }}
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ ARG ANSIBLE
ARG ANSIBLE_CORE
FROM ghcr.io/etkecc/ansible/base:${ALPINE}-${ANSIBLE_CORE}-${ANSIBLE}

Check warning on line 4 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build ansible image (fresh)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ghcr.io/etkecc/ansible/base:${ALPINE}-${ANSIBLE_CORE}-${ANSIBLE} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

ENV AGRU_CLEANUP="-c=false"
ENV ANSIBLE_LOG_PATH=" "
WORKDIR /playbook
ENTRYPOINT ["/bin/sh"]
Expand All @@ -12,6 +11,6 @@ COPY . /playbook
# Then initialize /upstream from submodules, and get rid of the `.git` directory.
# We don't need to carry that extra weight into the final image.
RUN git rev-parse HEAD > /playbook/source-commit && \
just pull-dependencies && \
git submodule update --init --recursive && \
rm -rf /playbook/.git && \
rm -rf /playbook/upstream/.git
9 changes: 1 addition & 8 deletions Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
ARG ALPINE
FROM ghcr.io/etkecc/base/build AS builder
ARG AGRU
ENV GOPROXY=""
RUN git clone --depth 1 -b $AGRU https://github.com/etkecc/agru.git && \
cd agru && just build && mv agru /usr/bin/agru

FROM alpine:${ALPINE}

Check warning on line 2 in Dockerfile.base

View workflow job for this annotation

GitHub Actions / Build base image

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG alpine:${ALPINE} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/
ARG ANSIBLE
ARG ANSIBLE_CORE
ENV PATH="/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin"

COPY --from=builder /usr/bin/agru /usr/bin/agru
RUN apk --no-cache add python3 py3-cryptography py3-jinja2 py3-packaging py3-paramiko py3-resolvelib py3-passlib py3-yaml \
git just openssh hugo && \
git openssh hugo && \
apk --no-cache add --virtual builddeps alpine-sdk py3-pip && \
ln -s /bin/uname /usr/local/bin/uname && \
ln -s /bin/rm /usr/local/bin/rm && \
Expand Down

0 comments on commit 6a9e101

Please sign in to comment.