Skip to content

Commit

Permalink
[QOLDEV-1005] update test container to handle running commands as non…
Browse files Browse the repository at this point in the history
…-root
  • Loading branch information
ThrawnCA committed Nov 14, 2024
1 parent 42538c5 commit 046ab85
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .docker/Dockerfile-template.ckan
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
FROM ckan/ckan-dev:{CKAN_VERSION}

# swap between root and unprivileged user
ARG ORIGINAL_USER
RUN ORIGINAL_USER=$(id -un)

ARG SITE_URL=http://ckan:5000/
ENV PYTHON_VERSION={PYTHON_VERSION}
ENV CKAN_VERSION={CKAN_VERSION}
Expand All @@ -8,20 +12,24 @@ ENV PYTHON={PYTHON}

WORKDIR "${APP_DIR}"

ENV DOCKERIZE_VERSION v0.6.1
RUN wget -O - https://github.com/jwilder/dockerize/releases/download/${DOCKERIZE_VERSION}/dockerize-linux-amd64-${DOCKERIZE_VERSION}.tar.gz \
| tar -C /usr/local/bin -xzvf -

RUN which ps || apt-get install -y procps

COPY .docker/test.ini $CKAN_INI

COPY . "${APP_DIR}"/

USER root

COPY bin/ckan_cli /usr/bin/

RUN chmod +x "${APP_DIR}"/bin/*.sh /usr/bin/ckan_cli

ENV DOCKERIZE_VERSION=v0.6.1
RUN wget -O - https://github.com/jwilder/dockerize/releases/download/${DOCKERIZE_VERSION}/dockerize-linux-amd64-${DOCKERIZE_VERSION}.tar.gz \
| tar -C /usr/local/bin -xzvf -

RUN which ps || apt-get install -y procps

USER "$ORIGINAL_USER"

# Init current extension.
RUN "${APP_DIR}"/bin/init-ext.sh

Expand Down

0 comments on commit 046ab85

Please sign in to comment.