Skip to content

Commit

Permalink
During startup, now performing standard env var substitution when rea…
Browse files Browse the repository at this point in the history
…ding the configuration files
  • Loading branch information
amazy committed Jun 14, 2023
1 parent 8d07b28 commit 6e6c105
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docker/orthanc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@ RUN if [[ ! -z "$TARGETPLATFORM" ]] && [[ "$TARGETPLATFORM" != "linux/amd64" ]];
RUN chmod +x /usr/share/orthanc/plugins-available/*
RUN chmod +x /usr/local/bin/*

RUN pip install envsubst==0.1.5

# configure SSL for azure rest sdk (azure object storage plugin)
ENV SSL_CERT_DIR=/etc/ssl/certs

Expand Down
4 changes: 4 additions & 0 deletions docker/orthanc/generateConfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import typing
import tempfile
import subprocess
from envsubst import envsubst

from helpers import JsonPath, logInfo, logWarning, logError, removeCppCommentsFromJson, isEnvVarDefinedEmptyOrTrue, enableVerboseModeForConfigGeneration
from configurator import OrthancConfigurator
Expand Down Expand Up @@ -35,6 +36,9 @@
logInfo("reading configuration from " + filePath)
with open(filePath, "r") as f:
content = f.read()

# perform standard env var substitution before trying to read the json file (https://github.com/orthanc-server/orthanc-builder/issues/9)
content = envsubst(content)
try:
cleanedContent = removeCppCommentsFromJson(content)
configFromFile = json.loads(cleanedContent)
Expand Down
2 changes: 2 additions & 0 deletions release-notes-docker-images.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ You should use the full image only if you need to use one of these:
Only the default tags are listed here. You just need to append `-full` for the full image.


- During startup, now performing standard env var substitution when reading the
configuration files.
23.6.0 : - POSSIBLE BREAKING CHANGE:
Created an 'orthanc' user (uid = 999) and 'orthanc' group (gid = 999) inside the image
to allow executing the image as a non root user. The image is still executing as root
Expand Down

0 comments on commit 6e6c105

Please sign in to comment.