Skip to content

Commit

Permalink
Add Docker Compose instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
maxvp committed Nov 12, 2024
1 parent 0d0c8af commit 14bc8a4
Showing 1 changed file with 39 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,13 @@ To install a certificate for use in a Docker container:

<Tabs> <TabItem label="Dockerfile">

1. Add the certificate to the Docker build process. For example:
To add the certificate during the build process:

1. Modify the Dockerfile. For example:

```docker title="Red Hat-based images"
FROM registry.access.redhat.com/ubi9/ubi:latest
# Or use: FROM centos:7 or FROM fedora:38
# Or FROM centos:7 or FROM fedora:38
# Install necessary certificates package
RUN dnf install -y ca-certificates
Expand All @@ -455,6 +457,7 @@ To install a certificate for use in a Docker container:

```docker title="Debian-based images"
FROM debian:12
# Or FROM ubuntu:22.04
# Install necessary certificates package
RUN apt-get update && apt-get install -y ca-certificates
Expand Down Expand Up @@ -495,6 +498,40 @@ To install a certificate for use in a Docker container:

<TabItem label="Docker Compose">

To add the certificate during runtime:

1. Add the certificate to your `docker-compose.yml` file. For example:

```diff lang="yaml" title="Red Hat-based images"
version: '3'
services:
redhat-app:
image: registry.access.redhat.com/ubi9/ubi:latest
+ volumes:
+ - /path/to/certificate.pem:/etc/pki/ca-trust/source/anchors/certificate.pem
+ entrypoint: /bin/sh -c "dnf install -y ca-certificates && update-ca-trust extract && app start"
```

```diff lang="yaml" title="Debian-based images"
version: '3'
services:
debian-app:
image: debian:12
+ volumes:
+ - /path/to/certificate.pem:/usr/local/share/ca-certificates/certificate.crt
+ entrypoint: /bin/sh -c "apt-get update && apt-get install -y ca-certificates && update-ca-certificates && app start"
```

```diff lang="yaml" title="Alpine-based images"
version: '3'
services:
alpine-app:
image: alpine:3.18
+ volumes:
+ - /path/to/cert.pem:/usr/local/share/ca-certificates/cert.pem
+ entrypoint: /bin/sh -c "apk add --no-cache ca-certificates && update-ca-certificates && app start"
```

</TabItem> </Tabs>

### Google Cloud
Expand Down

0 comments on commit 14bc8a4

Please sign in to comment.