Skip to content

Fixing Broken Images in Docker

Geoffroy Noël edited this page Feb 13, 2018 · 3 revisions

The following instructions are no longer applicable. If you are experiencing such issues you may want to try a newer version of Archetype.

If you are running DigiPal through Docker and your URL is not localhost:8080 but something like 192.168.90.100:8080, then you will probably also find that none of your manuscript images appear. This is because the version of Docker that you are using is based on VirtualBox and this does not use the normal localhost IP address. To fix this, the following steps are required. This only needs to be done once, and we will ensure that this step will not be necessary in future versions of the framework.

In summary, there is one line in a settings file which needs to be changed. Because of the way the setup works, you cannot easily use a conventional text editor to make the change. Instead you need to use a very old and not user-friendly (but very reliable) editor called vi.

  1. Start the DigiPal server in Kitematic, if necesary.

  2. Copy or make a note of the URL. Do not include the 'http://', and do not the colon or any numbers after it (e.g. ':8080'). The part that you copy should be an IP address, that is, it should consist of four numbers separated by '.' (e.g. '192.168.90.100')

  3. Click on 'Exec' in Kitematic. This will open a new terminal window.

  4. Type exactly the following into the window. Do not type any other key, even 'Return', unless specified. Be careful not to mis-type the commands, either: in some systems the backspace and delete keys do not work, and even small errors can have dramatic effects. However, the text in [square brackets and italics] are descriptions to help you so you should not type these.

    cd digipal<Return>

    vi local_settings.py<Return>

    [This command should open the local_settings.py file in your window, so you should now see the contents of the file.]

    /IMAGE_SERVER_HOST<Return>

    [Your cursor should now be at the start of a line which reads IMAGE_SERVER_HOST = 'localhost:8081'. We will now change that line.]

    wwwdwi [Do NOT press at this point!]

    [Each time you press 'w' you should see the cursor jump forward until it is at the start of the word 'localhost'. Pressing 'dw' should then delete the word 'localhost'. When you press 'i', nothing should appear to happen except that the word 'INSERT' will (probably) appear at the bottom of your window. This means that we are now in 'Insert' mode and you can type in new text.]

    <Type or paste in the IP address from Step 2 above, then press ESC>

    [You should now see a line of text something like IMAGE_SERVER_HOST = '192.168.90.100:8081', where the number before the colon is your address from Step 2 above. After you press , the word 'INSERT' should no longer be visible.]

    :wq<Return>

    [This should now save your changes and bring you back to the command line]

    <Ctrl-D>

    [This should now exit the terminal (your window will probably still be visible but you will probably see a different cursor, or perhaps cannot type anything at all).]

  5. Now Quit the Terminal application

  6. In Kitematic, restart the container

You should now be able to see the images in your DigiPal instance.

Clone this wiki locally