Ubuntu /etc/orthanc

1,617 views
Skip to first unread message

Ilan Tal

unread,
Jun 4, 2018, 5:01:17 AM6/4/18
to Orthanc Users
I am trying to install docker. In orthanc.json there is a list of users and passwords which needs to be customized.
I started off with all defaults and naturally it didn't have to user and password which I wanted.
I noticed in /etc/orthanc orthanc.json wasn't updated by docker-compose up --build -d.
Part of that command is
FROM osimis/orthanc:17.6.1
COPY orthanc.json /etc/orthanc/

Since it failed to update I decided to delete /etc/orthanc and let it recreate it.
That too failed to do anything.
My question is: what is the proper way to reinitialize /etc/orthanc?
Something did initialize it once, but I have no idea what.

Thanks,
Ilan

Alain Mazy

unread,
Jun 5, 2018, 2:52:22 AM6/5/18
to Ilan Tal, Orthanc Users
--

Alain Mazy / CTO 
a...@osimis.io / +32 494 31 67 27

Osimis

OSIMIS S.A. 
Rue bois Saint-Jean 15/1BE-4102 Seraing 
www.osimis.io

Twitter LinkedIn


Ilan Tal

unread,
Jun 5, 2018, 4:00:15 AM6/5/18
to Orthanc Users
Thanks Alain,
I decided the question was too complicated so I reformatted my ubuntu linux partition. This I can afford to do since my /home partition remains untouched.
I just ran docker-compose up --build -d where it asked me to install docker-compose, which I killed in the format partition. There are a whole group of files which were install as you can see from the attached file.

If I look at your script there is something I don't understand:

FROM osimis/orthanc:17.6.1
COPY orthanc.json /etc/orthanc/

What is FROM osimis/....? I have no such directory on my computer which may be the reason the
copy doesn't do anything?
That /etc/orthanc may have come from a previous installation of Orthanc which didn't use docker.
Another point which isn't clear to me is if I have to use sudo on "docker-compose up --build -d"?

In any case it does seem fairly clear that /etc/orthanc is somehow in the equation. (as of this
moment it still doesn't exist on my computer.)

Ilan

docker-install

Deon Kuhn

unread,
Jun 5, 2018, 5:45:31 AM6/5/18
to Orthanc Users
Hi Ilan

Your questions relate to how Docker works, and not specifically Orthanc, so I will answer for you.

1. The FROM osimis/..., in the context of a Dockerfile, tells Docker what image to use from DockerHub. It is unrelated to your local directory structure.
2. COPY orthanc.json /etc/orthanc/

Again, in the context of a Dockerfile, this is saying copy a file called orthanc.json, located in the same directory as the Dockerfile, into the container's /etc/orthanc folder. Again, the /etc/orthanc directory does not need to exist on your machine.

What I would suggest is, install docker on linux using the following, if you don't have them installed already: 



3. You should not need to run docker-compose using sudo.

Once you are ready to start up the sample Alain mentions, I suggest doing a docker-compose up --build without the -d, as that will show you the output and any errors it encounters while trying to run the docker containers.

Hope this helps!

Ilan Tal

unread,
Jun 6, 2018, 11:36:27 AM6/6/18
to Orthanc Users
Hi Deon,
Your post did help. I've been using virtual boxes for years and I see docker is a variation on that game. I will see if I can see the inside of the docker object where I would expect to see the missing /etc/orthanc folder.

I made myself part of the docker group so I wouldn't need to use sudo. I took your suggestions to install docker and docker compose, but I think everything was essentially in place. I don't think it did any damage, so it was just in case.
Then I tried your suggestion of docker-compose up --build without using the -d switch.
It seems to be in an endless loop giving:

orthanc_1        | W0606 15:12:38.054856 main.cpp:1238] Orthanc version: 1.2.0
orthanc_1        | W0606 15:12:38.061085 OrthancInitialization.cpp:173] Scanning folder "/etc/orthanc" for configuration files
orthanc_1        | W0606 15:12:38.061416 OrthancInitialization.cpp:125] Reading the configuration from: "/etc/orthanc/orthanc.json"
orthanc_1        | W0606 15:12:38.061916 OrthancInitialization.cpp:125] Reading the configuration from: "/etc/orthanc/plugins.json"
orthanc_1        | E0606 15:12:38.062088 OrthancInitialization.cpp:156] The configuration section "Plugins" is defined in 2 different configuration files
orthanc_1        | E0606 15:12:38.062352 main.cpp:1264] Uncaught exception, stopping now: [Bad file format] (code 15)
orthanc_1        | W0606 15:12:38.062751 main.cpp:1297] Orthanc has stopped
orthancinstall_orthanc_1 exited with code 255

hundreds of times. It has been going on well over an hour. There seems to be some sort of error in "Plugins" with 2 different configuration files. I'll show you my orthanc.json file in case there is something obviously wrong there.

{
  "Name": "Orthanc1",
  "StorageDirectory": "/home/ilan/OrthancStorage",
  "Plugins": [
     "/usr/share/orthanc/plugins"
  ],
  "DicomAet": "ORTHANC1",
  "DicomModalities": {
    "dcm4chee" : ["DCM4CHEE", "192.168.0.100", 11112, "Dcm4Chee"],
    "conquest" : ["CONQUESTSRV1", "192.168.0.104", 5678]
  },
  "RemoteAccessAllowed": true,
  "AuthenticationEnabled" : true,
  "RegisteredUsers" : {
    "ilan" : "shit"
  },
  "PostgreSQL": {
     "EnableIndex": true,
     "EnableStorage": false,
     "Host": "orthanc-index",
     "Database": "postgres",
     "Username": "postgres"
  }
}

I think at some stage I will just ^C out of the build routine as it is difficult to believe that it will end properly.

Thanks,
Ilan


Deon Kuhn

unread,
Jun 7, 2018, 1:52:50 AM6/7/18
to Orthanc Users

Hi Ilan

Your orthanc.json file seems to be in the wrong format, hence it's complaining about it in the build. The /etc/orthanc folder is not missing.

Let's try to get it working with basic configuration first, by removing the COPY instruction int he Dockerfile, and replacing the configuration with environment variables in the Dockerfile to start.

Here is an example of what a Dockerfile for orthanc would look like, with some environment variables specified. The full list of env configuration values can be found here:


Kill the build, and remove the COPY instruction, and try with a basic set of ENV variables, and try again without the -d option. 

FROM osimis/orthanc:18.4.4

ENV NAME=Orthanc

# Enable PostgreSQL Plugin
ENV PG_ENABLED=true

# PostgreSQL Enviroment Variables
ENV PG_INDEX_ENABLED=true
ENV PG_STORAGE_ENABLED=true
ENV PG_HOST={ENTER IP OR DOCKER COMPOSE SERVICE NAME TO POSTGRES DB}
ENV PG_PORT=5432
ENV PG_DB=postgres
ENV PG_USER=postgres

# Enable verbose
ENV VERBOSE_ENABLED=true

# Common HTTP port
ENV HTTP_PORT=8042


Ilan Tal

unread,
Jun 8, 2018, 8:10:10 AM6/8/18
to Orthanc Users
Hi Deon,
First of all I want to thank you for your help. I like your way of thinking, to try different ways of attacking the problem.
The environmental variables are new to me, so I decided to use what you said as a first attempt.
You said something was wrong with my file, so I decided to look at it again.
To be honest, most of it is copied, without really understanding what the details mean.
So if something is wrong, I have to look at the details to see what makes sense to me, who is supposed to understand what is written there.
The first thing I noticed is "Plugins". What plugins? I have nothing at /usr/share/orthanc on my disk. Maybe there is something on the docker file, but I can't see it.
So my first idea was to kill that.
Then the build started to complain about "StorageDirectory": "/home/ilan/OrthancStorage".
That I used to use before docker as the desired place to store the images. It might still be desirable, but I don't think docker will allow me that kind of freedom. Docker probably wants tight control over where the data is stored.
So my next step was to kill that line.
After that it complained about RemoteAccessAllowed. Along as docker knows how to handle remote access, my guess was that I could kill that line as well.
After that the compilation went through.
What I needed was your suggestion that something was wrong with what was written in the file, and which file it was.

The end of the build is:
orthanc_1        | W0608 11:36:29.069806 OrthancInitialization.cpp:1056] Storage directory: "/var/lib/orthanc/db"
orthanc_1        | W0608 11:36:29.072479 HttpClient.cpp:685] HTTPS will use the CA certificates from this file: /etc/orthanc
orthanc_1        | W0608 11:36:29.144144 ServerScheduler.cpp:134] The server scheduler has started
orthanc_1        | W0608 11:36:29.177924 LuaContext.cpp:103] Lua says: Lua toolbox installed
orthanc_1        | W0608 11:36:29.178518 ServerContext.cpp:181] Disk compression is disabled
orthanc_1        | W0608 11:36:29.178602 ServerIndex.cpp:1402] No limit on the number of stored patients
orthanc_1        | W0608 11:36:29.180400 ServerIndex.cpp:1419] No limit on the size of the storage area
orthanc_1        | W0608 11:36:29.200446 main.cpp:822] DICOM server listening with AET ORTHANC1 on port: 4242
orthanc_1        | W0608 11:36:29.200616 MongooseServer.cpp:1027] HTTP compression is enabled
orthanc_1        | W0608 11:36:29.210379 main.cpp:757] HTTP server listening on port: 8042
orthanc_1        | W0608 11:36:29.210483 main.cpp:644] Orthanc has started

My address is 192.168.1.23 so I tried http://192.168.1.23:8042/app/explorer.html and nothing is answering.
So the distance to the goal is a lot closer, but still not there.

Thanks,
Ilan

Ilan Tal

unread,
Jun 10, 2018, 4:26:47 AM6/10/18
to Orthanc Users
I am still stuck in that http://192.168.0.17:8042/app/explorer.html is not answering.
My terminal output looks OK:

ilan@ilan-Lenovo-G585:~/OrthancInstall$ docker-compose up --build
Creating network "orthancinstall_default" with the default driver
Building orthanc
Step 1/2 : FROM osimis/orthanc:17.6.1
 ---> 7fbc9b606786
Step 2/2 : COPY orthanc.json /etc/orthanc/
 ---> Using cache
 ---> 52efb60d7495
Successfully built 52efb60d7495
Successfully tagged orthancinstall_orthanc:latest
Creating orthancinstall_orthanc-index_1 ...
Creating orthancinstall_orthanc-index_1 ... done
Creating orthancinstall_orthanc_1 ...
Creating orthancinstall_orthanc_1 ... done
Attaching to orthancinstall_orthanc-index_1, orthancinstall_orthanc_1
orthanc-index_1  | 2018-06-10 08:05:28.466 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
orthanc-index_1  | 2018-06-10 08:05:28.466 UTC [1] LOG:  listening on IPv6 address "::", port 5432
orthanc-index_1  | 2018-06-10 08:05:28.540 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
orthanc-index_1  | 2018-06-10 08:05:28.876 UTC [21] LOG:  database system was shut down at 2018-06-08 13:38:40 UTC
orthanc-index_1  | 2018-06-10 08:05:29.369 UTC [1] LOG:  database system is ready to accept connections
orthanc_1        | W0610 08:05:31.628601 main.cpp:1238] Orthanc version: 1.2.0
orthanc_1        | W0610 08:05:31.726500 OrthancInitialization.cpp:173] Scanning folder "/etc/orthanc" for configuration files
orthanc_1        | W0610 08:05:31.753265 OrthancInitialization.cpp:125] Reading the configuration from: "/etc/orthanc/orthanc.json"
orthanc_1        | W0610 08:05:31.768511 OrthancInitialization.cpp:125] Reading the configuration from: "/etc/orthanc/plugins.json"
orthanc_1        | W0610 08:05:31.777280 OrthancInitialization.cpp:125] Reading the configuration from: "/etc/orthanc/storage.json"
orthanc_1        | W0610 08:05:31.782861 OrthancInitialization.cpp:125] Reading the configuration from: "/etc/orthanc/remote-access.json"
orthanc_1        | W0610 08:05:31.812080 FromDcmtkBridge.cpp:189] Loading the embedded dictionaries
orthanc_1        | W0610 08:05:31.933889 OrthancInitialization.cpp:488] Registering JPEG Lossless codecs
orthanc_1        | W0610 08:05:31.933994 OrthancInitialization.cpp:493] Registering JPEG codecs
orthanc_1        | W0610 08:05:31.974411 main.cpp:632] Loading plugin(s) from: /usr/share/orthanc/plugins
orthanc_1        | W0610 08:05:32.026342 PluginsManager.cpp:268] Registering plugin 'postgresql-storage' (version 2.0)
orthanc_1        | W0610 08:05:32.027172 PluginsManager.cpp:167] The PostgreSQL storage area is currently disabled, set "EnableStorage" to "true" in the "PostgreSQL" section of the configuration file of Orthanc
orthanc_1        | W0610 08:05:32.196686 PluginsManager.cpp:268] Registering plugin 'web-viewer' (version 2.2)
orthanc_1        | W0610 08:05:32.196841 PluginsManager.cpp:167] Initializing the Web viewer
orthanc_1        | W0610 08:05:32.197613 PluginsManager.cpp:167] Web viewer using 1 threads for the decoding of the DICOM images
orthanc_1        | W0610 08:05:32.197685 PluginsManager.cpp:167] Storing the cache of the Web viewer in folder: /var/lib/orthanc/db/WebViewerCache
orthanc_1        | W0610 08:05:32.267263 PluginsManager.cpp:167] Web viewer using a cache of 100 MB
orthanc_1        | W0610 08:05:32.267994 PluginsManager.cpp:167] Using GDCM instead of the DICOM decoder that is built in Orthanc
orthanc_1        | W0610 08:05:32.476870 PluginsManager.cpp:268] Registering plugin 'dicom-web' (version 0.3)
orthanc_1        | W0610 08:05:32.478572 PluginsManager.cpp:167] URI to the DICOMweb REST API: /dicom-web/
orthanc_1        | W0610 08:05:32.479632 PluginsManager.cpp:167] URI to the WADO-URI API: /wado
orthanc_1        | W0610 08:05:32.616869 PluginsManager.cpp:268] Registering plugin 'osimis-web-viewer' (version 1.0.0.0-71fbc89)
orthanc_1        | W0610 08:05:32.617112 PluginsManager.cpp:167] Initializing the Web viewer
orthanc_1        | W0610 08:05:32.617582 PluginsManager.cpp:167] Using GDCM instead of the DICOM decoder that is built in Orthanc
orthanc_1        | W0610 08:05:32.655862 PluginsManager.cpp:268] Registering plugin 'authorization' (version 0.1.0)
orthanc_1        | W0610 08:05:32.655981 PluginsManager.cpp:167] Initializing the authorization plugin
orthanc_1        | W0610 08:05:32.656278 PluginsManager.cpp:167] No section "Authorization" in the configuration file, the authorization plugin is disabled
orthanc_1        | W0610 08:05:32.704322 PluginsManager.cpp:268] Registering plugin 'wsi' (version 0.4)
orthanc_1        | W0610 08:05:32.706811 PluginsManager.cpp:167] The whole-slide imaging plugin will use at most 2 threads to transcode the tiles
orthanc_1        | W0610 08:05:32.733682 PluginsManager.cpp:268] Registering plugin 'postgresql-index' (version 2.0)
orthanc_1        | W0610 08:05:32.734520 PluginsManager.cpp:167] Using PostgreSQL index
orthanc_1        | W0610 08:05:33.305936 PluginsManager.cpp:268] Registering plugin 'serve-folders' (version 1.2.0)
orthanc_1        | W0610 08:05:33.306410 PluginsManager.cpp:167] ServeFolders: Empty configuration file: No additional folder will be served!
orthanc_1        | W0610 08:05:33.331450 PluginsManager.cpp:268] Registering plugin 'worklists' (version 1.2.0)
orthanc_1        | W0610 08:05:33.331607 PluginsManager.cpp:167] Sample worklist plugin is initializing
orthanc_1        | W0610 08:05:33.332149 PluginsManager.cpp:167] Worklists server is disabled by the configuration file
orthanc_1        | W0610 08:05:33.332392 main.cpp:1047] Using a custom database from plugins
orthanc_1        | W0610 08:05:33.332557 OrthancInitialization.cpp:1056] Storage directory: "/var/lib/orthanc/db"
orthanc_1        | W0610 08:05:33.334220 HttpClient.cpp:685] HTTPS will use the CA certificates from this file: /etc/orthanc
orthanc_1        | W0610 08:05:33.444086 ServerScheduler.cpp:134] The server scheduler has started
orthanc_1        | W0610 08:05:33.479031 LuaContext.cpp:103] Lua says: Lua toolbox installed
orthanc_1        | W0610 08:05:33.481052 ServerContext.cpp:181] Disk compression is disabled
orthanc_1        | W0610 08:05:33.482732 ServerIndex.cpp:1402] No limit on the number of stored patients
orthanc_1        | W0610 08:05:33.485926 ServerIndex.cpp:1419] No limit on the size of the storage area
orthanc_1        | W0610 08:05:33.509648 main.cpp:822] DICOM server listening with AET ORTHANC1 on port: 4242
orthanc_1        | W0610 08:05:33.515685 MongooseServer.cpp:1027] HTTP compression is enabled
orthanc_1        | W0610 08:05:33.529349 main.cpp:757] HTTP server listening on port: 8042
orthanc_1        | W0610 08:05:33.531716 main.cpp:644] Orthanc has started

The only thing which looks a bit strange is the IP of 0.0.0.0
orthanc-index_1  | 2018-06-10 08:05:28.466 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
orthanc-index_1  | 2018-06-10 08:05:28.466 UTC [1] LOG:  listening on IPv6 address "::", port 5432

The orthanc.json looks like
{
  "Name": "Orthanc1",

  "DicomAet": "ORTHANC1",
  "DicomModalities": {
    "dcm4chee" : ["DCM4CHEE", "192.168.0.100", 11112, "Dcm4Chee"],
    "conquest" : ["CONQUESTSRV1", "192.168.0.104", 5678]
  },
  "AuthenticationEnabled" : true,
  "RegisteredUsers" : {
    "ilan" : "shit"
  },
  "PostgreSQL": {
     "EnableIndex": true,
     "EnableStorage": false,
     "Host": "orthanc-index",
     "Database": "postgres",
     "Username": "postgres"
  }
}

ping 192.168.0.17 answers with no problem. In short, I see nothing obvious but Orthanc doesn't answer.

Ilan Tal

unread,
Jun 10, 2018, 5:33:16 AM6/10/18
to Orthanc Users
I saw: 
orthanc_1        | W0610 08:05:32.656278 PluginsManager.cpp:167] No section "Authorization" in the configuration file, the authorization plugin is disabled
and thought something might be wrong with my user name, password.
I changed  "AuthenticationEnabled" : true, to false
and commented out the user name, pw.

There was no change, so that isn't the problem

I thought I might need
  "RemoteAccessAllowed": true,

so I put it back in. The compilation failed because it complained that it found the entry in 2 separate locations.
I again removed that line and the compilation went through again, but still no answer from the server.

What could possibly be wrong???

Ilan Tal

unread,
Jun 10, 2018, 6:20:04 AM6/10/18
to Orthanc Users
Previously I had such a mess that I reformatted my Linux partition. I wanted to start with a clean slate.
I wanted to see a "sample configuration file" so I typed Orthanc in my terminal. It suggested

sudo apt install orthanc

which indeed greatly helped. Now http://192.168.0.17:8042/app/explorer.html
finally answers.

Next problem: user name, pw. It recognizes that the user name, pw is required but it won't accept my values.

I had to remove
  "RemoteAccessAllowed": true,
because it said it was defined in 2 places and the compilation wouldn't go through.
So it could be the "other place" is saying   "RemoteAccessAllowed": false,
which would clearly cause my user name, pw to fail.

My question: how can I put in   "RemoteAccessAllowed": true,
and have it agree to compile?

Deon Kuhn

unread,
Jun 12, 2018, 2:33:55 AM6/12/18
to Orthanc Users
Hi Ilan

It sounds like you are making some progress, appologise for not being able to reply sooner, I was sick the last few days.


I advise having a detailed read as this explains a lot of the things that you are struggling with, especially the question below.

What is comes down to is, when using the Docker orthanc, certain configuration values are split into certain configuration files, not just one big file. If you specify the configuration value in the wrong file, as orthanc assigns default values, it will complain that it is registered twice.

I would also advise reading up a bit about how Docker works, just what the Dockerfile does, and how env variables can be used to set configuration values, as an alternative to using the configuration files.

The AllowRemoteAccess would indeed be why your end-point did not answer back previously.

To set it again, you will need to use the correct configuration file, and add the COPY instruction in the Dockerfile for that configuration file.

I hope this doesn't confuse matters further, but perhaps have a read and if you are still stuck, be sure to ask again.

Ilan Tal

unread,
Jun 12, 2018, 8:14:45 AM6/12/18
to Orthanc Users
Hi Deon,
I'm glad you recovered from your sickness. You are my light in this long learning curve.

There is one huge question in the back of my mind: are the problems coming from something wrong in the configuration of Orthanc, or something I have wrong in docker itself? It could be, for example, that I have docker incompletely installed so that it isn't trying to communicate with the web browser. I don't know how to go about answering that question.

In any case from the error messages I got the distinct feeling that not everything is in one file, but rather split over 3 or 4 files. I know of no way of seeing the contents of the docker itself. Perhaps I need to go to the git hub and look at source files? I don't know if it is by intent or by accident that the -d switch covers up a lot of sin. The compilation completes with the -d switch and won't complete without it, if I use
  "RemoteAccessAllowed": true,
Is it really completing, or just giving the sense that all is well? It seems to be "clean" (to compile with or without the -d) one should modify the copy command to include all the files and to have the changes in the proper files.

Still my basic question is: is the problem in the Orthanc files, or with docker itself?

Now I am off to read all that you suggest.
Thanks again for all your help,
Ilan

Ilan Tal

unread,
Jun 12, 2018, 12:51:37 PM6/12/18
to Orthanc Users
Hi Deon,
That quick guide looked like a very nice place to start, so I went to the OrthancInstall directory and fired it off from there.
It pulled a lot of stuff over and said Orthanc started which was very promising.
The end result was that the server still doesn't answer.
This seems to imply the problem is somehow in docker itself???

Just to be fair I did docker-compose down so that 2 versions wouldn't be competing with one another.
Then I did a reboot, back to OrthancInstall and tried again. This time it didn't need to pull anything, but the server isn't answering.
Should I expect it to answer with just
docker run --publish=80:8042 --publish=104:4242 osimis/orthanc
I don't care what it answers, just something to start with.

I need your advice on what to expect. Should it answer something, and approximately what???

I'll include the printout so you can see what I saw the first time around.
ilan@ilan-Lenovo-G585:~/OrthancInstall$ docker run --publish=80:8042 --publish=104:4242 osimis/orthanc
Unable to find image 'osimis/orthanc:latest' locally
latest: Pulling from osimis/orthanc
297061f60c36: Pull complete
e9ccef17b516: Pull complete
dbc33716854d: Pull complete
8fe36b178d25: Pull complete
686596545a94: Pull complete
837d636c620b: Pull complete
2d7714c273d5: Pull complete
0c0129c85662: Pull complete
0e7bfbef9e65: Pull complete
6b437149bf93: Pull complete
06fa181956ee: Pull complete
f95197c95f27: Pull complete
Digest: sha256:0f8fbac8c89364cb505dd7eaa6a1696d3611db1f540f679cf88d73c026cf2052
Status: Downloaded newer image for osimis/orthanc:latest
STORAGE: Generating '/etc/orthanc/storage.json'...
PLUGINS: Generating '/etc/orthanc/plugins.json'...
LISTENER: Generating '/etc/orthanc/remote-access.json'...
HTTP: Generating '/etc/orthanc/http.json'...
Startup command: Orthanc /etc/orthanc
W0612 16:19:08.122640 main.cpp:1298] Orthanc version: 1.3.2
W0612 16:19:08.128500 OrthancInitialization.cpp:168] Scanning folder "/etc/orthanc" for configuration files
W0612 16:19:08.128844 OrthancInitialization.cpp:120] Reading the configuration from: "/etc/orthanc/plugins.json"
W0612 16:19:08.129377 OrthancInitialization.cpp:120] Reading the configuration from: "/etc/orthanc/storage.json"
W0612 16:19:08.129867 OrthancInitialization.cpp:120] Reading the configuration from: "/etc/orthanc/remote-access.json"
W0612 16:19:08.130201 OrthancInitialization.cpp:120] Reading the configuration from: "/etc/orthanc/http.json"
W0612 16:19:08.253640 main.cpp:671] Loading plugin(s) from: /usr/share/orthanc/plugins
W0612 16:19:08.254070 OrthancInitialization.cpp:1004] SQLite index directory: "/var/lib/orthanc/db"
W0612 16:19:08.255897 OrthancInitialization.cpp:1074] Storage directory: "/var/lib/orthanc/db"
W0612 16:19:08.431297 HttpClient.cpp:691] HTTPS will use the CA certificates from this file: /etc/ssl/certs/ca-certificates.crt
W0612 16:19:08.433179 ServerScheduler.cpp:135] The server scheduler has started
W0612 16:19:08.433587 LuaContext.cpp:103] Lua says: Lua toolbox installed
W0612 16:19:08.433881 ServerContext.cpp:182] Disk compression is disabled
W0612 16:19:08.433928 ServerIndex.cpp:1403] No limit on the number of stored patients
W0612 16:19:08.433993 ServerIndex.cpp:1420] No limit on the size of the storage area
W0612 16:19:08.435991 main.cpp:863] DICOM server listening with AET ORTHANC on port: 4242
W0612 16:19:08.436142 MongooseServer.cpp:1075] HTTP compression is enabled
W0612 16:19:08.443707 main.cpp:796] HTTP server listening on port: 8042
W0612 16:19:08.445445 main.cpp:683] Orthanc has started

If it is docker itself, at least I know not to look in the Orthanc direction. It is something more basic.

Thanks,
Ilan

Alain Mazy

unread,
Jun 13, 2018, 3:28:10 AM6/13/18
to Ilan Tal, Orthanc Users
HI Ilan,

Note that once you've typed  docker run --publish=80:8042 --publish=104:4242 osimis/orthanc
Orthanc is accessible on port 80 on your localhost.  the --publish=80:8042 maps the port 8042 inside the container to your host port 80.
If you use --publish=8042:8042, you should have access to Orthanc on http://localhost:8042

Br

Alain

Ilan Tal

unread,
Jun 13, 2018, 4:07:56 AM6/13/18
to Orthanc Users

Hi Alain,
Thanks for the confirmation. That is what I expected should happen. In fact there is no answer, aside from timeout. That is a useful test because from the software point of view there were no errors.
It means I can stop looking for problems on the Orthanc side and start look for what might be missing on the docker side. You can even publish that on your tutorial as it looks like a very clean test. There is no point in going on until the user sees a response.

Thanks,
Ilan

Ilan Tal

unread,
Jun 13, 2018, 7:04:10 AM6/13/18
to Orthanc Users
I hate to bother you for problems not directly connected to Orthanc, but I am going crazy.

I decided to use docker run --publish=80:8042 --publish=104:4242 osimis/orthanc
as my gold standard. It is simple, direct and depends upon nothing else.

The browser on localhost:8042 always times out and gives no answer.
The problem is clearly in docker and I would reformat my Linux partition yet a second time if I thought it would do any good.

In my readings I saw that docker-ce was obolete and docker.io should be used.
I can't quote the source at this very minute, but that is what I remember.

Since I knew the problem was in docker, I tried going through what I could find in the hopes that something would work so I could use Orthanc under docker. The local copy of Orthanc which I had installed worked fine, except that it couldn't handle dicom compressed files. For compressed files I needed the docker version.

As part of one source on how to install docker, I used
sudo apt install docker.io
which gave me
The following packages will be REMOVED:
  docker-ce

Ok, so remove docker-ce....

Then I got:
ilan@ilan-Lenovo-G585:~$  docker run --publish=80:8042 --publish=104:4242 osimis/orthanc
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.

OK, not a great idea to remove docker-ce, so reinstall it
sudo apt-get install docker-ce
Package docker-ce is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

I fixed the problem so it would install and....
sudo apt-get install docker-ce
The following packages will be REMOVED:
  docker.io

Now docker.io has been removed. Now

ilan@ilan-Lenovo-G585:~$  docker run --publish=80:8042 --publish=104:4242 osimis/orthanc
gives
W0613 10:41:15.193396 main.cpp:796] HTTP server listening on port: 8042
W0613 10:41:15.196040 main.cpp:683] Orthanc has started
but localhost:8042 gives timeout

Clearly something is wrong with docker, but I don't know how to fix it.
Thanks,
Ilan

Thibault Nélis

unread,
Jun 13, 2018, 8:28:55 AM6/13/18
to orthan...@googlegroups.com
On Wed, 2018-06-13 at 04:04 -0700, Ilan Tal wrote:
> In my readings I saw that docker-ce was obolete and docker.io should
> be used.
> I can't quote the source at this very minute, but that is what I
> remember.

There is no docker-ce package in Debian/Ubuntu AFAIK, only docker.io
(so named because of a conflicting package named docker unrelated to
the container runtime in most Debian-based distributions).

There is a docker-ce package in the upstream (Docker, Inc.) APT
repositories for Debian/Ubuntu.

If you prefer the latest version, go for docker-ce.
If you prefer a version tailored for your OS, go for docker.io.

docker.io (Debian): 1.13
docker.io (Ubuntu): 17.12
docker-ce (Docker): 18.03

> Ok, so remove docker-ce....
>
> Then I got:
> ilan@ilan-Lenovo-G585:~$ docker run --publish=80:8042 --
> publish=104:4242 osimis/orthanc
> docker: Cannot connect to the Docker daemon at
> unix:///var/run/docker.sock. Is the docker daemon running?.

Check your permissions on the docker UNIX socket
(/var/run/docker.sock). Because full access to the Docker engine API
essentially translates to root access (trivial escalation: mount root-
owned directories as volumes in container running as root), I fully
expected all well-integrated packages not to give access to anyone by
default (that would include docker.io).

Either elevate with sudo, add user to special group (usually named
"docker") or have the daemon listen via TCP on localhost (then use the
DOCKER_HOST environment variable to reach it without specifying -H for
every command).

Obviously, also check the status of the service with "systemctl status
docker". If it's not running, look for the logs.

Note: I do think trying to solve your core issue with docker.io is a
good idea, though if it doesn't help then there's no problem continuing
with docker-ce if you trust the upstream maintainers (they *did* break
a few things in the past, but it's usually fine these days). Look for
the state of your iptables in particular, check the daemon --iptables
option, etc.
--
Thibault Nélis <t...@osimis.io>
Osimis

Thibault Nélis

unread,
Jun 13, 2018, 9:17:24 AM6/13/18
to orthan...@googlegroups.com
On Mon, 2018-06-11 at 23:33 -0700, Deon Kuhn wrote:
> The AllowRemoteAccess would indeed be why your end-point did not
> answer back previously.
>
> To set it again, you will need to use the correct configuration file,
> and add the COPY instruction in the Dockerfile for that configuration
> file.

Note that the relevant remote-access.json file is generated by default.

https://osimis.atlassian.net/wiki/spaces/OKB/pages/26738689/How+to+use+
osimis+orthanc+Docker+images#Howtouseosimis/orthancDockerimages?-
Listener
(Configuration file generated by default: Yes)

The simplest approach is to simply not do anything (i.e. don't set
AllowRemoteAccess in orthanc.json or anywhere else).

Since there is no reason not to listen on all interfaces when running
in a container (access is normally restricted externally via port
publishing), the settings here are provided for completeness only
(they're not really useful).

Deon Kuhn

unread,
Jun 13, 2018, 9:18:05 AM6/13/18
to Orthanc Users

Hi Ilan

docker run --publish=80:8042 --publish=104:4242 osimis/orthanc

You are publishing on port 80, so it should be localhost:80

Deon Kuhn

unread,
Jun 13, 2018, 9:22:14 AM6/13/18
to Orthanc Users
Oh and Ilan,

I just ran your snippet of code and it worked, try running http://0.0.0.0/app/explorer.html

Deon Kuhn

unread,
Jun 13, 2018, 9:22:55 AM6/13/18
to Orthanc Users
Not the 0.0.0.0, sometimes localhost doesn't want to work with docker.

Deon Kuhn

unread,
Jun 13, 2018, 9:23:16 AM6/13/18
to Orthanc Users
I meant NOTE.

Ilan Tal

unread,
Jun 14, 2018, 1:33:24 AM6/14/18
to Orthanc Users
Hi Deon,
Yesterday I had to leave just as your message came in, so I couldn't check anything.
You are brilliant, absolutely brilliant. Suddenly I see output on localhost:80.
I was always looking on port 8042. So docker IS working.
Now I can continue on, knowing one more fact which I didn't understand.

I would like to ask your opinion on the above point.
There is a positive point about explicitly using port 8042 - then you know you mean to talk just Orthanc, not to something random on default port 80. Then would I use --publish=8042:8042, or just drop the publish command?

Now I can pick up on what I was doing before I was stopped dead in my tracks.
I did in fact manage to learn a lot with all the effort.

Thanks,
Ilan

Deon Kuhn

unread,
Jun 14, 2018, 1:46:02 AM6/14/18
to Orthanc Users
Hi Iilan

Yes, the first port is the one that gets published to the host machine, the second is the one orthanc is listening on. So I would keep the publish command.

So: 80:8042

80 = Host machine
8042 = Docker container port

It is important to note that the publish command does not make orthanc listen on 8042, that is the orthanc config, but that the publish command says to expose 8042 on port 80 on host.

Now, if you publish on the host machine to 8042, and want to access externally, you must make sure that the external port 8042 is actually open, otherwise you will only be able to do it on localhost.

Ilan Tal

unread,
Jun 14, 2018, 3:51:04 AM6/14/18
to Orthanc Users
HI Deon,
I will take your advice and use port 80 and port 104 for DICOM.
I would like to pick your brain just a bit more.

//  "RemoteAccessAllowed": true,
I had trouble with this command using docker-compose up --build (without -d).
So the last time around I left it commented out.
To my TOTAL AMAZEMENT I could access my laptop using my desktop through the LAN.
(and of course I have the user name, password in effect as well)..

I don't know what the default is but I sort of guessed it would be false.
Is there any way to know what the default actually is?
If it is true, all makes sense, but if it is false I don't know how the LAN access could work.

I managed to break my desktop version of Orthanc docker, but now I should be able to fix it with the proper ports of 80, 104. Previously everything was hocus-pocus and so long as I didn't touch it, everything worked.

Meanwhile a couple of DICOM bugs came in for my viewer, so I'll need to look at them.

Deon Kuhn

unread,
Jun 14, 2018, 5:04:09 AM6/14/18
to Orthanc Users
This page shows all default values for all configuration: https://osimis.atlassian.net/wiki/spaces/OKB/pages/26738689/How+to+use+osimis+orthanc+Docker+images#Howtouseosimis/orthancDockerimages?-HTTP

LISTENER_LISTEN_ALL_ADDRJSON boolean"true"RemoteAccessAllowed

Thibault Nélis

unread,
Jun 15, 2018, 11:18:32 AM6/15/18
to orthan...@googlegroups.com
On Thu, 2018-06-14 at 00:51 -0700, Ilan Tal wrote:
> // "RemoteAccessAllowed": true,
> I had trouble with this command using docker-compose up --build
> (without -d).
> So the last time around I left it commented out.
> To my TOTAL AMAZEMENT I could access my laptop using my desktop
> through the LAN.
> (and of course I have the user name, password in effect as well)..
>
> I don't know what the default is but I sort of guessed it would be
> false.
> Is there any way to know what the default actually is?
> If it is true, all makes sense, but if it is false I don't know how
> the LAN access could work.

This is unrelated to Orthanc; it is contained by the container runtime
and it is the job of that runtime to do the relevant port forwarding.

With Docker, you can specify the network interface address to bind the
forwarder (in addition to the published port).

$ docker container run --detach --publish=80:8042
docker.io/osimis/orthanc:latest
a0e6e6e98d0c3b6e9052b8ef3b51ad1a1c45ea779463a93f5938479c648fc970
$ echo $DOCKER_HOST
sandbox.local:2375
$ http GET sandbox.local/system
HTTP/1.1 200 OK
Content-Encoding: gzip
Content-Length: 168
Content-Type: application/json; charset=utf-8

{
"ApiVersion": "1.0",
"DatabaseBackendPlugin": null,
"DatabaseVersion": 6,
"DicomAet": "ORTHANC",
"DicomPort": 4242,
"HttpPort": 8042,
"Name": "",
"PluginsEnabled": true,
"StorageAreaPlugin": null,
"Version": "1.3.2"
}

$ docker container rm --force
a0e6e6e98d0c3b6e9052b8ef3b51ad1a1c45ea779463a93f5938479c648fc970
a0e6e6e98d0c3b6e9052b8ef3b51ad1a1c45ea779463a93f5938479c648fc970
$ docker container run --detach --publish=127.0.0.1:80:8042
docker.io/osimis/orthanc:latest
7a1f99ea92b56420da93093c53c97216731b8171f5cd8c4cc912ccdb3aa0972c
$ http GET sandbox.local/system

http: error: ConnectionError: HTTPConnectionPool(host='sandbox.local',
port=80): Max retries exceeded with url: /system (Caused by
NewConnectionError('<requests.packages.urllib3.connection.HTTPConnectio
n object at 0x7f2262d462e8>: Failed to establish a new connection:
[Errno 113] No route to host',)) while doing GET request to URL: http:/
/sandbox.local/system
$ ssh -t sandbox http GET 127.0.0.1/system
HTTP/1.1 200 OK
Content-Encoding: gzip
Content-Length: 168
Content-Type: application/json; charset=utf-8

{
"ApiVersion": "1.0",
"DatabaseBackendPlugin": null,
"DatabaseVersion": 6,
"DicomAet": "ORTHANC",
"DicomPort": 4242,
"HttpPort": 8042,
"Name": "",
"PluginsEnabled": true,
"StorageAreaPlugin": null,
"Version": "1.3.2"
}


Notice the extra prefix in the --publish option. The above demonstrates
that specifying the address of the loopback network interface restricts
access to the local host (sandbox.local) as you seem to expect.

Thibault Nélis

unread,
Jun 15, 2018, 11:19:58 AM6/15/18
to orthan...@googlegroups.com
On Thu, 2018-06-14 at 02:04 -0700, Deon Kuhn wrote:
> This page shows all default values for all configuration: https://osi
> mis.atlassian.net/wiki/spaces/OKB/pages/26738689/How+to+use+osimis+or
> thanc+Docker+images#Howtouseosimis/orthancDockerimages?-HTTP
>
> LISTENER_LISTEN_ALL_ADDR JSON boolean "true" Rem
> oteAccessAllowed

Disabling this will not do what you expect (at least in the context of
this discussion). As I alluded to in another post on this thread, this
Orthanc setting merely configures it to deny requests from anything but
127.0.0.1. In a virtual network such as the Docker bridge networks as
used by default by the Docker container runtime and docker-compose,
this means nothing can access the Orthanc server (except processes you
spawn using `docker container exec`).

This setting is mostly for services running in host networking mode, it
can be safely ignored in 99% of normal operational scenarios.

Sidenote: The name of the setting itself is also misleading (my bad) as
Orthanc doesn't actually allow binding its listening socket on specific
network interface addresses (contrary to what I said in my previous
message). This is a peer socket address check performed on every
request. The next version of the Osimis Orthanc Bundle (likely 18.6)
will contain clarifications.
https://bitbucket.org/osimis/orthanc-builder/pull-requests/40

Ilan Tal

unread,
Jun 15, 2018, 11:48:38 AM6/15/18
to Orthanc Users
I would like to thank all who helped me. When I started it was all hocus-pocus.
THE most important feature of orthanc on docker is the ability to handle compressed DICOM files and pass them to the client as uncompressed.
ImageJ can't read compressed DICOM files and docker running Orthanc solves the problem.

I want one Orthanc server which many clients can access, so having the server handle only 127.0.0.1 means it is useless.
Fortunately Deon pointed out that remote access is enabled by default, i.e. problem solved.

Thanks to all the help, I now have control. Just for testing purposes I have one server setup on my desktop and another on my laptop and each can push or pull studies from each other. The remote access works in fact.

Reply all
Reply to author
Forward
0 new messages