| layout | showcase-page | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| title | Docker Customization | ||||||||||||||
| permalink | /how-to/docker_customization/ | ||||||||||||||
| menubar | docs_menu | ||||||||||||||
| accent | slate | ||||||||||||||
| eyebrow | How-To Guide | ||||||||||||||
| description | Customize the container image when you need private trust anchors, enterprise TLS compatibility, or pip configuration changes during Docker build. | ||||||||||||||
| hero_icons |
|
||||||||||||||
| hero_pills |
|
||||||||||||||
| hero_links |
|
Use Docker customization when the default container image is correct for the application but not quite correct for the network or package-install environment you need to run inside.
Add internal root or intermediate certificates when outbound HTTPS calls rely on enterprise PKI or TLS interception infrastructure.
Changes in the customization folders only take effect after the Simple Chat container image is rebuilt and redeployed.
Use the repo-level pip configuration when package installation needs custom indexes, mirrors, or enterprise network settings during build.
Confirm the trust bundle and network behavior from inside the running container instead of assuming the image build succeeded.
The certificate and pip-customization steps here affect images built from the repo Dockerfile. Native Python App Service deployments need different host- or app-level configuration for certificate trust and package resolution.
Simple Chat supports adding private, self-signed, or enterprise-issued certificate authorities to the container image during Docker build. This is useful when the app or Semantic Kernel plugins need to make TLS-validated outbound connections to internal HTTPS endpoints that are not signed by a public CA.
Common cases include:
- Internal HTTPS APIs called by HTTP or OpenAPI-based plugins
- Private Azure OpenAI or other model endpoints presented through enterprise TLS inspection or internal PKI
- SQL gateways, reverse proxies, or service endpoints that present certificates chaining to a private root or intermediate CA
- Internal services used behind private DNS, firewalls, or corporate network boundaries
Put each CA certificate file in the repository folder below before building the container:
docker-customization/custom-ca-certificates/
Requirements:
- Use
.crtfile extensions - Use PEM-encoded certificates
- Add the CA certificate, not the leaf/server certificate, unless your trust model explicitly requires it
- Include any required intermediate CA certificates if your internal chain is not complete
Example:
docker-customization/custom-ca-certificates/
corp-root-ca.crt
corp-intermediate-ca.crt
The application Docker build copies everything from docker-customization/custom-ca-certificates/ into the container trust anchor location and then refreshes the system CA bundle.
The current build in application/single_app/Dockerfile does the following:
- Copies certificate files into
/etc/pki/ca-trust/source/anchors - Runs
update-ca-trust enableandupdate-ca-trust extract - Carries the resulting trust store into the final runtime image
- Sets
SSL_CERT_FILE,SSL_CERT_DIR, andREQUESTS_CA_BUNDLEso Python HTTPS clients can use the updated CA bundle
This means outbound TLS checks from the container can trust your added CAs when the underlying client library uses the system or Python certificate bundle.
- Export the required CA certificate chain from your internal PKI or security team.
- Convert or save the certificate files as PEM
.crtfiles. - Place the files in
docker-customization/custom-ca-certificates/. - Rebuild the Simple Chat container image.
- Redeploy the updated container.
- Re-test the plugin or outbound integration that previously failed TLS validation.
If you build locally with Docker, the certificate files only take effect after a rebuild.
Example:
docker build -f application/single_app/Dockerfile -t simplechat:custom-ca .If you deploy with the repo's container-based Azure deployment flow, ensure the updated files are present in the repo before the image build triggered by your deployment pipeline.
This customization is intended for container-based deployments where Simple Chat makes outbound TLS connections to services that chain to private trust anchors.
It commonly helps with:
- HTTP, OpenAPI, and REST-style Semantic Kernel plugins that call internal HTTPS endpoints
- Azure OpenAI or other HTTPS AI endpoints reached through enterprise PKI, private networking, or TLS interception infrastructure
- Python-based outbound requests made by application code or plugin code that rely on the container trust store
It may also help with SQL-related integrations when the database driver or gateway validates certificates through the operating system or Python trust bundle. Some database drivers also support their own explicit CA configuration, so certificate-store updates and driver-level SSL settings should be treated as complementary, not interchangeable.
After rebuilding and deploying, validate from inside the running container when possible.
Useful checks include:
ls /etc/pki/ca-trust/source/anchorspython -c "import os; print(os.environ.get('SSL_CERT_FILE')); print(os.environ.get('REQUESTS_CA_BUNDLE'))"python -c "import requests; print(requests.get('https://your-internal-endpoint/health', timeout=15).status_code)"If the endpoint still fails certificate validation, confirm:
- The CA file is PEM-encoded and ends in
.crt - The correct root and intermediate certificates were included
- The server is presenting the expected certificate chain
- Hostname resolution matches the certificate subject or SAN
- The failing client library actually uses the system/Python trust store
- This only affects container-based deployments built from the repo Dockerfile. Native Python App Service deployments need certificate trust configured at the host or app level separately.
- Adding a CA certificate does not fix DNS, firewall, private endpoint, routing, or proxy issues.
- Trusting a private CA expands what the container will trust. Only add certificates from sources your organization explicitly approves.
Add customization as needed to the docker-customization/pip.conf file in the repository root. This will be used during docker build.