Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
using alpine as base

Signed-off-by: Kevin Klopfenstein <kk@sudo-i.net>
  • Loading branch information
chifu1234 committed Dec 27, 2020
1 parent 00a450d commit 16fb3bf
Showing 1 changed file with 41 additions and 41 deletions.
82 changes: 41 additions & 41 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
FROM python:3-slim-buster

## Labels
LABEL maintainer="oliverbaehler@hotmail.com, kk@sudo-i.net"

## Environment Variables

### Tavern Configuration
ENV DEBUG false
ENV LOG_TO_FILE ""
ENV TEST_DIRECTORY "/tavern/"
ENV SCRIPT_DIRECTORY "/scripts"

### Paths
ENV PATH "~/.local/bin:${PATH}"
ENV PYTHONPATH "$SCRIPT_DIRECTORY"

### Base Configuration
ENV TAVERN_VERSION "1.11.1"
ENV TAVERN_USER_ID 1500
ENV TAVERN_GROUP_ID 1500
ENV SET_PERMISSIONS "true"

## Copy Entrypoint
COPY ./entrypoint.sh /

## Create Tavern User
RUN groupadd -g "${TAVERN_GROUP_ID}" tavern && useradd -s /bin/false -u ${TAVERN_USER_ID} -m -g tavern tavern \
&& mkdir -p ${TEST_DIRECTORY} ${SCRIPT_DIRECTORY} \
&& chown -R tavern:tavern ${TEST_DIRECTORY} ${SCRIPT_DIRECTORY} \
&& chmod +x /entrypoint.sh && chown tavern: /entrypoint.sh

## Install Tavern
USER tavern
RUN pip install --user tavern==${TAVERN_VERSION}

## Working Directory
WORKDIR "${TEST_DIRECTORY}"

## EntryPoint
ENTRYPOINT ["/entrypoint.sh"]
FROM python:3-alpine

## Labels
LABEL maintainer="oliverbaehler@hotmail.com, kk@sudo-i.net"

## Environment Variables

### Tavern Configuration
ENV DEBUG false
ENV LOG_TO_FILE ""
ENV TEST_DIRECTORY "/tavern/"
ENV SCRIPT_DIRECTORY "/scripts"

### Paths
ENV PATH "~/.local/bin:${PATH}"
ENV PYTHONPATH "$SCRIPT_DIRECTORY"

### Base Configuration
ENV TAVERN_VERSION "1.11.1"
ENV TAVERN_USER_ID 1500
ENV TAVERN_GROUP_ID 1500
ENV SET_PERMISSIONS "true"

## Create Tavern User
RUN addgroup -g "${TAVERN_GROUP_ID}" tavern && adduser -s /bin/false -u ${TAVERN_USER_ID} -D -G tavern tavern \
&& apk add --no-cache bash \
&& mkdir -p ${TEST_DIRECTORY} ${SCRIPT_DIRECTORY} \
&& chown -R tavern:tavern ${TEST_DIRECTORY} ${SCRIPT_DIRECTORY}

## Install Tavern
USER tavern
RUN pip install --user tavern==${TAVERN_VERSION}

## Copy Entrypoint
COPY ./entrypoint.sh /

## Working Directory
WORKDIR "${TEST_DIRECTORY}"

## EntryPoint
ENTRYPOINT ["/entrypoint.sh"]

0 comments on commit 16fb3bf

Please sign in to comment.