Skip to content

Commit

Permalink
4 update python image
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Rademacher committed Oct 25, 2023
1 parent a8ca8a3 commit f6b522d
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 17 deletions.
2 changes: 0 additions & 2 deletions .cache/pip/pip.conf

This file was deleted.

30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM python:3.11-bookworm
LABEL maintainer="[email protected]"

ARG GID=1000
ARG UID=1000
ARG UNAME=codewars

ARG PIPCACHE="/.cache/pip"

RUN groupadd \
--gid ${GID} \
--non-unique \
${UNAME}

RUN useradd \
--create-home \
--gid ${GID} \
--home-dir /home/codewars \
--shell /bin/bash \
--uid ${UID} \
${UNAME}

RUN pip install --upgrade pip \
&& pip install git+https://github.com/codewars/python-test-framework.git#egg=codewars_test

USER ${UNAME}
WORKDIR /codewars/python311

# setup
VOLUME "${PIPCACHE}"
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ Use the build script in order to build the custom Python 3.11 Docker image
`andrerademacher/codewars-python311`.

```bash
container/build.sh
ci/build_docker_image.sh
```

## Run command in container
The `container.sh` script makes running commands in the Docker container easy!
To open a shell, just add the "sh" command:
To open a shell, just add the "bash" command:
```bash
container.sh sh
container.sh bash
```

The current Python version can be shown like this:
Expand Down
3 changes: 2 additions & 1 deletion container/build.sh → ci/build_docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
SCRIPT_DIRECTORY="$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")")"
cd "${SCRIPT_DIRECTORY}" || exit

docker build \
cd .. \
&& docker build \
--no-cache \
--pull \
--tag "andrerademacher/codewars-python311" \
Expand Down
3 changes: 1 addition & 2 deletions container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ docker run \
--name 'codewars-python311' \
--rm \
--tty \
--user "$(id -u)":"$(id -g)" \
--volume "${PWD}/.cache":/.cache \
--volume "pipcache":/.cache \
--volume "${PWD}":/codewars/python311 \
andrerademacher/codewars-python311 "$@"
7 changes: 0 additions & 7 deletions container/Dockerfile

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion kata/GetNthEvenNumber/test_NthEven.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from kata.GetNthEvenNumber.NthEven import nth_even


@test.describe("Tests for nth even number")
@test.describe("nth even number kata")
def nth_even_test():
@test.it("positive input values")
def positive_input_values():
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion kata/RemoveTheTime/test_Remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from kata.RemoveTheTime.Remove import shorten_to_date


@test.describe("Basic Tests")
@test.describe("Remove the time kata")
def basic_tests():
@test.it("Basic Tests")
def basic_tests():
Expand Down

0 comments on commit f6b522d

Please sign in to comment.