Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #193

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Official Docker images are in the form library/<app> while non-official
# images are in the form <user>/<app>.
FROM docker.io/library/python:3.12.0-alpine3.18 as compile-stage
FROM docker.io/library/python:3.12.2-alpine3.19 as compile-stage

###
# Unprivileged user variables
Expand All @@ -12,7 +12,7 @@ ENV VIRTUAL_ENV="${CISA_HOME}/.venv"
# Versions of the Python packages installed directly
ENV PYTHON_PIP_VERSION=24.0
ENV PYTHON_PIPENV_VERSION=2023.12.1
ENV PYTHON_SETUPTOOLS_VERSION=69.1.0
ENV PYTHON_SETUPTOOLS_VERSION=69.1.1
ENV PYTHON_WHEEL_VERSION=0.42.0

###
Expand Down Expand Up @@ -53,7 +53,7 @@ RUN pipenv check --verbose \

# Official Docker images are in the form library/<app> while non-official
# images are in the form <user>/<app>.
FROM docker.io/library/python:3.12.0-alpine3.18 as build-stage
FROM docker.io/library/python:3.12.2-alpine3.19 as build-stage

###
# For a list of pre-defined annotation keys and value types see:
Expand Down Expand Up @@ -108,4 +108,4 @@ USER ${CISA_USER}:${CISA_GROUP}
EXPOSE 8080/TCP
VOLUME ["/var/log"]
ENTRYPOINT ["example"]
CMD ["--log-level", "DEBUG"]
CMD ["--log-level", "DEBUG", "8", "2"]
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ appropriate for Docker containers and the major languages that we use.
To run the `cisagov/example` image via Docker:

```console
docker run cisagov/example:0.0.1
docker run cisagov/example:0.2.0
```

### Running with Docker Compose ###
Expand All @@ -37,7 +37,7 @@ docker run cisagov/example:0.0.1

services:
example:
image: cisagov/example:0.0.1
image: cisagov/example:0.2.0
volumes:
- type: bind
source: <your_log_dir>
Expand Down Expand Up @@ -82,7 +82,7 @@ environment variables. See the

services:
example:
image: cisagov/example:0.0.1
image: cisagov/example:0.2.0
volumes:
- type: bind
source: <your_log_dir>
Expand Down Expand Up @@ -125,7 +125,7 @@ environment variables. See the
1. Pull the new image:

```console
docker pull cisagov/example:0.0.1
docker pull cisagov/example:0.2.0
```

1. Recreate and run the container by following the [previous instructions](#running-with-docker).
Expand Down Expand Up @@ -164,12 +164,12 @@ and then update dependencies as you would above.
The images of this container are tagged with [semantic
versions](https://semver.org) of the underlying example project that they
containerize. It is recommended that most users use a version tag (e.g.
`:0.0.1`).
`:0.2.0`).

| Image:tag | Description |
|-----------|-------------|
|`cisagov/example:0.0.1`| An exact release version. |
|`cisagov/example:0.0`| The most recent release matching the major and minor version numbers. |
|`cisagov/example:0.2.0`| An exact release version. |
|`cisagov/example:0.2`| The most recent release matching the major and minor version numbers. |
|`cisagov/example:0`| The most recent release matching the major version number. |
|`cisagov/example:edge` | The most recent image built from a merge into the `develop` branch of this repository. |
|`cisagov/example:nightly` | A nightly build of the `develop` branch of this repository. |
Expand Down Expand Up @@ -225,7 +225,7 @@ Build the image locally using this git repository as the [build context](https:/

```console
docker build \
--tag cisagov/example:0.0.1 \
--tag cisagov/example:0.2.0 \
https://github.com/cisagov/example.git#develop
```

Expand Down Expand Up @@ -256,7 +256,7 @@ Docker:
--file Dockerfile-x \
--platform linux/amd64 \
--output type=docker \
--tag cisagov/example:0.0.1 .
--tag cisagov/example:0.2.0 .
```

## New repositories from a skeleton ##
Expand Down
4 changes: 2 additions & 2 deletions src/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ name = "pypi"
# List any Python dependencies for the image here
[packages]
# This should match the version of the image
example = {file = "https://github.com/cisagov/skeleton-python-library/archive/v0.0.1.tar.gz"}
example = {file = "https://github.com/cisagov/skeleton-python-library/archive/v0.2.0.tar.gz"}

# This version should match the version of Python in the image
[requires]
python_full_version = "3.12.0"
python_full_version = "3.12.2"
21 changes: 18 additions & 3 deletions src/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.1"
__version__ = "0.2.0"
2 changes: 2 additions & 0 deletions tests/container_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
ENV_VAR = "ECHO_MESSAGE"
ENV_VAR_VAL = "Hello World from docker compose!"
READY_MESSAGE = "This is a debug message"
DIVISION_MESSAGE = "8 / 2 == 4.000000"
SECRET_QUOTE = "Three may keep a secret, if two of them are dead." # nosec
RELEASE_TAG = os.getenv("RELEASE_TAG")
VERSION_FILE = "src/version.txt"
Expand Down Expand Up @@ -53,6 +54,7 @@ def test_output(dockerc, main_container):
# make sure container exited if running test isolated
dockerc.wait(main_container.id)
log_output = main_container.logs()
assert DIVISION_MESSAGE in log_output, "Division message not found in log output."
assert SECRET_QUOTE in log_output, "Secret not found in log output."


Expand Down
Loading