From 645e39aa188b1256288cdf5ada9e6d4fbe276dd1 Mon Sep 17 00:00:00 2001 From: Craig Thacker Date: Thu, 22 Feb 2024 20:22:52 +0000 Subject: [PATCH] Update --- ...-docker.yaml => build-minimal-docker.yaml} | 6 ++--- containers/{test => minimal}/Dockerfile | 22 ++++++++++++++----- containers/{test => minimal}/env.sh | 0 containers/{test => minimal}/start.sh | 0 4 files changed, 20 insertions(+), 8 deletions(-) rename .github/workflows/{build-alpine-test-docker.yaml => build-minimal-docker.yaml} (93%) rename containers/{test => minimal}/Dockerfile (79%) rename containers/{test => minimal}/env.sh (100%) rename containers/{test => minimal}/start.sh (100%) diff --git a/.github/workflows/build-alpine-test-docker.yaml b/.github/workflows/build-minimal-docker.yaml similarity index 93% rename from .github/workflows/build-alpine-test-docker.yaml rename to .github/workflows/build-minimal-docker.yaml index 3753990..a2073cb 100644 --- a/.github/workflows/build-alpine-test-docker.yaml +++ b/.github/workflows/build-minimal-docker.yaml @@ -1,4 +1,4 @@ -name: 'Run Docker - Alpine Test' +name: 'Run Docker - Minimal' # Allow run manually on: @@ -7,11 +7,11 @@ on: working_directory: type: string description: What working directory should be passed to the script - default: "containers/test" + default: "containers/minimal" docker_image_name: type: string description: 'Docker Image name?' - default: "azdo-agent-containers/test" + default: "azdo-agent-containers/minimal" enable_debug_mode: type: boolean description: 'Whether debug mode should be enable for within the script' diff --git a/containers/test/Dockerfile b/containers/minimal/Dockerfile similarity index 79% rename from containers/test/Dockerfile rename to containers/minimal/Dockerfile index 05ea1dd..ff1671a 100644 --- a/containers/test/Dockerfile +++ b/containers/minimal/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:latest -LABEL org.opencontainers.image.title=test +LABEL org.opencontainers.image.title=alpine LABEL org.opencontainers.image.source=https://github.com/libre-devops/azdo-agent-containers #Set args with blank values - these will be over-written with the CLI @@ -30,8 +30,6 @@ ENV NORMAL_USER ${NORMAL_USER} # Environment variables for pyenv ENV HOME /home/${NORMAL_USER} -ENV PYENV_ROOT /home/${NORMAL_USER}/.pyenv -ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH #Set path vars ENV PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt:/opt/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.local/bin:/home/${NORMAL_USER}/.local:/home/${NORMAL_USER}:/home/${NORMAL_USER}/.tenv:/home/${NORMAL_USER}/.tenv/bin:/home/${NORMAL_USER}/.pkenv:/home/${NORMAL_USER}/.pkenv/bin:/home/${NORMAL_USER}/.pyenv:/home/${NORMAL_USER}/.pyenv/bin:/home/${NORMAL_USER}/.pyenv/shims:/home/${NORMAL_USER}/.local/bin" @@ -56,15 +54,29 @@ RUN adduser -s /bin/bash -D -h /home/${NORMAL_USER} ${NORMAL_USER} && \ libxml2-dev \ libxslt-dev \ linux-headers \ - nano \ ncurses-dev \ openssl-dev \ openssl1.1-compat@edge \ readline-dev \ sqlite-dev \ sudo \ - tk-dev \ xz-dev && \ apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache \ lttng-ust && \ echo $PATHVAR > /etc/environmentecho $PATHVAR > /etc/environment + +RUN chown -R ${NORMAL_USER}:${NORMAL_USER} /opt && \ + chown -R ${NORMAL_USER}:${NORMAL_USER} /home/${NORMAL_USER} + +COPY start.sh /home/${NORMAL_USER}/start.sh +COPY env.sh /home/${NORMAL_USER}/env.sh +RUN chmod +x /home/${NORMAL_USER}/start.sh && \ + chmod +x /home/${NORMAL_USER}/env.sh && \ + chown -R "${NORMAL_USER}:${NORMAL_USER}" /home/${NORMAL_USER} + +USER ${NORMAL_USER} +WORKDIR /home/${NORMAL_USER} +CMD [ "./start.sh" ] + +USER ${NORMAL_USER} +WORKDIR /home/${NORMAL_USER} diff --git a/containers/test/env.sh b/containers/minimal/env.sh similarity index 100% rename from containers/test/env.sh rename to containers/minimal/env.sh diff --git a/containers/test/start.sh b/containers/minimal/start.sh similarity index 100% rename from containers/test/start.sh rename to containers/minimal/start.sh