diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 01341bd..0024b39 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -419,8 +419,6 @@ 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 @@ -428,7 +426,7 @@ jobs: 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 diff --git a/README.md b/README.md index e070fbf..a39cfcf 100644 --- a/README.md +++ b/README.md @@ -31,13 +31,17 @@ docker run cisagov/example:0.2.0 ### Running with Docker Compose ### +<<<<<<< HEAD 1. Create a `docker-compose.yml` file similar to the one below to use [Docker Compose](https://docs.docker.com/compose/) or use the [sample `docker-compose.yml`](docker-compose.yml) provided with this repository. +======= +1. Create a `compose.yml` file similar to the one below to use [Docker Compose](https://docs.docker.com/compose/). +>>>>>>> eafe720594319b9503bd5e6d7e5b59e61ff9d6d5 ```yaml --- - version: "3.7" + name: skeleton-docker services: <<<<<<< HEAD @@ -52,6 +56,7 @@ this repository. restart: always ======= example: +<<<<<<< HEAD image: cisagov/example:0.2.0 volumes: - type: bind @@ -85,6 +90,19 @@ this repository. driver: default config: - subnet: 172.16.202.0/24 +======= + environment: + - ECHO_MESSAGE="Hello from docker compose" + image: cisagov/example:0.2.0 + ports: + - protocol: tcp + published: "8080" + target: 8080 + volumes: + - source: + target: /var/log + type: bind +>>>>>>> eafe720594319b9503bd5e6d7e5b59e61ff9d6d5 ``` 1. Start the container and detach: @@ -107,11 +125,15 @@ environment variables. See the - `privkey.pem` - `users.txt` +<<<<<<< HEAD 1. Then add the secrets to your `docker-compose.yml` file: +======= +1. Then add the secret to your `compose.yml` file: +>>>>>>> eafe720594319b9503bd5e6d7e5b59e61ff9d6d5 ```yaml --- - version: "3.7" + name: skeleton-docker secrets: fullchain_pem: @@ -134,6 +156,7 @@ environment variables. See the restart: always ======= example: +<<<<<<< HEAD image: cisagov/example:0.2.0 volumes: - type: bind @@ -174,6 +197,22 @@ environment variables. See the driver: default config: - subnet: 172.16.202.0/24 +======= + environment: + - ECHO_MESSAGE="Hello from docker compose" + image: cisagov/example:0.2.0 + ports: + - protocol: tcp + published: "8080" + target: 8080 + secrets: + - source: quote_txt + target: quote.txt + volumes: + - source: + target: /var/log + type: bind +>>>>>>> eafe720594319b9503bd5e6d7e5b59e61ff9d6d5 ``` ## Updating your container ## @@ -237,9 +276,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 ## @@ -290,8 +329,13 @@ The following ports are exposed by this container: | 587 | Mail submission | | 993 | IMAPS | +<<<<<<< HEAD The sample [Docker composition](docker-compose.yml) publishes the exposed ports at 1025, 1587, and 1993, respectively. +======= +The sample [Docker composition](compose.yml) publishes the +exposed port at 8080. +>>>>>>> eafe720594319b9503bd5e6d7e5b59e61ff9d6d5 ## Environment variables ## diff --git a/buildx-dockerfile.sh b/buildx-dockerfile.sh deleted file mode 100755 index 46710e9..0000000 --- a/buildx-dockerfile.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -# Create a Dockerfile suitable for a multi-platform build using buildx -# See: https://docs.docker.com/buildx/working-with-buildx/ - -set -o nounset -set -o errexit -set -o pipefail - -DOCKERFILE=Dockerfile -DOCKERFILEX=Dockerfile-x - -# We don't want this expression to expand. -# shellcheck disable=SC2016 -sed 's/^FROM /FROM --platform=$TARGETPLATFORM /g' < $DOCKERFILE > $DOCKERFILEX diff --git a/docker-compose.yml b/compose.yml similarity index 68% rename from docker-compose.yml rename to compose.yml index 6bc83dd..f34f227 100644 --- a/docker-compose.yml +++ b/compose.yml @@ -1,8 +1,8 @@ --- -version: "3.7" - # This Docker composition file is used to build and test the container +name: skeleton-docker + secrets: fullchain_pem: file: ./src/secrets/fullchain.pem @@ -19,6 +19,7 @@ services: # e.g., --build-arg VERSION=0.0.1 context: . dockerfile: Dockerfile +<<<<<<< HEAD:docker-compose.yml image: cisagov/postfix init: true restart: always @@ -44,8 +45,18 @@ services: - target: 8421 published: 8421 >>>>>>> 0d48ebd47a28a887868ea3093e675e95f3843561 +======= + environment: + - ECHO_MESSAGE=Hello World from docker compose! + image: cisagov/example + init: true + ports: + - mode: host +>>>>>>> eafe720594319b9503bd5e6d7e5b59e61ff9d6d5:compose.yml protocol: tcp - mode: host + published: "8421" + target: 8421 + restart: "no" secrets: - source: fullchain_pem target: fullchain.pem @@ -54,6 +65,7 @@ services: - source: users_txt target: users.txt +<<<<<<< HEAD:docker-compose.yml networks: front: driver: bridge @@ -61,3 +73,11 @@ networks: driver: default config: - subnet: 172.16.202.0/24 +======= + example-version: + # Run the container to collect version information + command: --version + image: cisagov/example + init: true + restart: "no" +>>>>>>> eafe720594319b9503bd5e6d7e5b59e61ff9d6d5:compose.yml diff --git a/requirements-dev.txt b/requirements-dev.txt index d7a04ed..0561d0a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,5 @@ --requirement requirements-test.txt ipython pipenv +# The bump-version script requires at least version 3 of semver. semver>=3