Skip to content

Commit

Permalink
Merge https://github.com/cisagov/skeleton-docker into lineage/skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdonnnj committed Feb 7, 2025
2 parents 575d1e8 + eafe720 commit 35c58bc
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 51 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -414,16 +414,14 @@ jobs:
path: ${{ env.BUILDX_CACHE_DIR }}
restore-keys: |
${{ env.BASE_CACHE_KEY }}
- name: Create cross-platform support Dockerfile-x
run: ./buildx-dockerfile.sh
- name: Build and push platform images to registries
id: docker_build
uses: docker/build-push-action@v6
with:
cache-from: type=local,src=${{ env.BUILDX_CACHE_DIR }}
cache-to: type=local,dest=${{ env.BUILDX_CACHE_DIR }}
context: .
file: ./Dockerfile-x
file: ./Dockerfile
labels: ${{ needs.prepare.outputs.labels }}
platforms: |
linux/amd64
Expand Down
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@ docker run cisagov/example:0.2.0

### Running with Docker Compose ###

1. Create a `docker-compose.yml` file similar to the one below to use [Docker Compose](https://docs.docker.com/compose/).
1. Create a `compose.yml` file similar to the one below to use [Docker Compose](https://docs.docker.com/compose/).

```yaml
---
version: "3.7"
name: skeleton-docker

services:
example:
image: cisagov/example:0.2.0
volumes:
- type: bind
source: <your_log_dir>
target: /var/log
environment:
- ECHO_MESSAGE="Hello from docker compose"
image: cisagov/example:0.2.0
ports:
- target: 8080
published: 8080
protocol: tcp
- protocol: tcp
published: "8080"
target: 8080
volumes:
- source: <your_log_dir>
target: /var/log
type: bind
```
1. Start the container and detach:
Expand All @@ -70,32 +70,32 @@ environment variables. See the
Better lock it in your pocket.
```

1. Then add the secret to your `docker-compose.yml` file:
1. Then add the secret to your `compose.yml` file:

```yaml
---
version: "3.7"
name: skeleton-docker
secrets:
quote_txt:
file: quote.txt
services:
example:
image: cisagov/example:0.2.0
volumes:
- type: bind
source: <your_log_dir>
target: /var/log
environment:
- ECHO_MESSAGE="Hello from docker compose"
image: cisagov/example:0.2.0
ports:
- target: 8080
published: 8080
protocol: tcp
- protocol: tcp
published: "8080"
target: 8080
secrets:
- source: quote_txt
target: quote.txt
volumes:
- source: <your_log_dir>
target: /var/log
type: bind
```

## Updating your container ##
Expand Down Expand Up @@ -155,9 +155,9 @@ If you want to add or remove dependencies you would update the `src/Pipfile` fil
and then update dependencies as you would above.

> [!NOTE]
> You should only specify packages that are explicitly needed for your Docker
> configuration. Allow [Pipenv] to manage the dependencies of the specified
> packages.
> You should only specify packages that are direct requirements of
> your Docker configuration. Allow [Pipenv] to manage the dependencies
> of the specified packages.

## Image tags ##

Expand Down Expand Up @@ -192,7 +192,7 @@ The following ports are exposed by this container:
|------|----------------|
| 8080 | Example only; nothing is actually listening on the port |

The sample [Docker composition](docker-compose.yml) publishes the
The sample [Docker composition](compose.yml) publishes the
exposed port at 8080.

## Environment variables ##
Expand Down
15 changes: 0 additions & 15 deletions buildx-dockerfile.sh

This file was deleted.

18 changes: 9 additions & 9 deletions docker-compose.yml → compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
version: "3.7"

# This Docker composition file is used to build and test the container

name: skeleton-docker

secrets:
quote_txt:
file: ./src/secrets/quote.txt
Expand All @@ -15,23 +15,23 @@ services:
# e.g., --build-arg VERSION=0.0.1
context: .
dockerfile: Dockerfile
image: cisagov/example
init: true
restart: "no"
environment:
- ECHO_MESSAGE=Hello World from docker compose!
image: cisagov/example
init: true
ports:
- target: 8421
published: 8421
- mode: host
protocol: tcp
mode: host
published: "8421"
target: 8421
restart: "no"
secrets:
- source: quote_txt
target: quote.txt

example-version:
# Run the container to collect version information
command: --version
image: cisagov/example
init: true
restart: "no"
command: --version
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--requirement requirements-test.txt
ipython
pipenv
# The bump-version script requires at least version 3 of semver.
semver>=3

0 comments on commit 35c58bc

Please sign in to comment.