Executing Docker container and loading page file

I’m trying to install a docker extension; that extension being IMAPSync. Although I’m using Container Manager which is an app in Synology system.

I’ve read the documentation numerous times, although I cannot get the extension to work. In particular with regards to the compose file which is returning a bind error which is specific to this container ?

 imapsync:
    container_name: imapsync
    ports: 
    - 12580:8080 
    restart: unless-stopped
    image: gilleslamiral/imapsync
    volumes:
        - /usr/bin/imapsync/imapsync_form_extra.html:/var/tmp/imapsync_form_extra.html \
        - /usr/bin/imapsync_cgi:/var/tmp/imapsync_cgi  \

There is also a html file, from what I understand there is an html file which I can’t get to load. That file being imapsync_form_extra.html ?

Remove those backslashes (\) at the end of your mount paths

I’m still getting a bind mount failure ?

Would you show the error message please?
Does the HTML file being mounted exist?

If a mount path does not exist, Docker attempts to create it as a directory. You need to have an HTML file ready at that path for your container to work


Here is the error message.

Then the error seems self explanatory

I understand that I need to create the paths but it’s this html file that supposedly does exist; although one can create it ?

I’m not sure what IMAPsync expects you to provide in this HTML file

Here’s the default one created with this image:

<!DOCTYPE html>

<!-- $Id: imapsync_form_extra.html,v 1.35 2024/08/06 18:43:50 gilles Exp gilles $ -->

<html lang="en" id="top">


<head>
<!--
        <script 
        data-ad-client="ca-pub-3325993554161060" 
        async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js">
        </script>
-->

        <title>Mailbox Imapsync Online</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" 
	integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
	
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" 
	integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
        
        <link rel="stylesheet" href="imapsync_form.css">
        <link rel="stylesheet" href="../S/style.css" type="text/css"   />

        <link rel="license" href="https://imapsync.lamiral.info/NOLIMIT">

        <noscript>
        <link rel="stylesheet" href="noscript.css">
        </noscript>

</head>

<body>


<div class="scripton">
        <!-- will appear if some tests fail -->
        <pre id="tests" class="collapse"></pre>
        <!-- hidden stuff that must exit for the tests -->
        <div class="hidden">
                <input type="checkbox" id="test_checkbox">
                <input type="text" id="test_text">
                <input type="radio" id="test_radio1" name="test_radio" value="first" >
                <input type="radio" id="test_radio2" name="test_radio" value="second" >
        </div>
</div>

<div class="container-fluid" >

    <div class="row">
        <div class="text-center">
            <a href="https://imapsync.lamiral.info/">
            <img alt="Imapsync home" title="Imapsync home page" src="https://imapsync.lamiral.info/X/logo_imapsync_Xn.png" height="38" width="60">
            </a>
            <a href="#top" title="Top of the page" class="btn btn-info " role="button">Top</a>
            <a href="#bottom" title="Bottom of the page" class="btn btn-info active" role="button">Bottom</a>
        </div>
    </div>

    <h1 class="text-center">Imapsync Online</h1>

    <p class="text-center larger"> <strong>Copy/synchronize</strong> a <strong>complete Mailbox</strong> to another,
    without <strong>duplicates!</strong>
    </p>
    

    <form id="form" action="/cgi-bin/imapsync" method="post" autocomplete="on">
        <div id="form_row" class="row">
            <div id="account1" class="col-md-5" >
                <fieldset>
                <legend class="text-center h2">IMAP source Mailbox</legend>

                <label for="user1">Login</label> (usually an email address)
                <div class="input-group form-group">
                    <span class="input-group-addon"><i class="glyphicon glyphicon-user"> </i></span>
                    <input
                        data-toggle="tooltip" data-placement="bottom" title="It is usually an email address or its left part before @"
                        type="text" class="form-control input-lg" id="user1" name="user1" tabindex="1"
                        placeholder="Enter login name"
                    >
                </div>

                <label for="password1">Password</label>
                <label class="checkbox-inline out">
                    <input type="checkbox" id="showpassword1"> show password
                </label>
                <div class="input-group form-group">
                    <span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
                    <input
                        data-toggle="tooltip" data-placement="bottom" title="Passwords are not stored on the server"
                        type="password" class="form-control input-lg" id="password1" name="password1" tabindex="2"
                        placeholder="Enter password"
                >
                </div>

                <label for="host1">IMAP Server hostname</label> (or its IP address)
                <div class="input-group form-group">
                    <span class="input-group-addon"><i class="glyphicon glyphicon-cloud"></i></span>
                    <input
                        data-toggle="tooltip" data-placement="bottom" title="IMAP transfers are done with encryption if the servers support it."
                        list="servers1" type="text" class="form-control input-lg" id="host1" name="host1" tabindex="3"
                        placeholder="Enter IMAP source server name or IP address"
                    >
                    <datalist id="servers1">
                        <option value="imap.gmail.com">
                        <option value="outlook.office365.com">
                        <option value="imap.hostinger.com">
                        <option value="ssl0.ovh.net">
                        <option value="email-ssl.com.br">
                        <option value="imap.mail.yahoo.com">
                    </datalist>
                </div>
                
                <div class="form-group collapse extra_param">
                    <label class="checkbox-inline">
                    <input 
                        data-toggle="tooltip" data-placement="bottom" title="Be careful with this option"
                        type="checkbox" id="delete1" name="delete1"
                    >
                    Move sync. Deletes messages on source mailbox after a successful transfer.
                    </label>
                </div>

                <div class="form-group collapse extra_param" > 
                <label for="subfolder1">Sub-folder</label>
                <div class="input-group form-group">
                    <span class="input-group-addon"><i class="glyphicon glyphicon-folder-open"></i></span>
                    <input
                        data-toggle="tooltip" data-placement="bottom" title="A subfolder where all the source mailbox comes from."
                        type="text" class="form-control input-lg" id="subfolder1" name="subfolder1"
                        placeholder="Enter sub-folder name"
                    >
                </div>
                </div>
                
                <div>
                    <br>
                </div>
                </fieldset>
            </div>

            <div id="parameters" class="col-md-2" >
                <div>
                        <br>
                </div>
                
                <div>
                    <label class="checkbox-inline">
                    <input 
                        data-toggle="tooltip" data-placement="bottom" title="Shows what would be done without really doing it."
                        type="checkbox" id="dry" name="dry"
                    >
                    Just verbose, no real sync.
                    </label>
                </div>
                
                <div>
                    <label class="checkbox-inline">
                    <input 
                        data-toggle="tooltip" data-placement="bottom" title="Checks credentials without syncing anything."
                        type="checkbox" id="justlogin" name="justlogin"
                    >
                        Just checks credentials.
                    </label>
                </div>
        
                <div>
                    <label class="checkbox-inline">
                    <input 
                        data-toggle="tooltip" data-placement="bottom" title="Shows folders sizes and exits."
                        type="checkbox" id="justfoldersizes" name="justfoldersizes"
                    >
                    Just presents folders sizes.
                    </label>
                </div>
        
                <div>
                    <label class="checkbox-inline">
                    <input 
                        data-toggle="tooltip" data-placement="bottom" title="Just create the folder hierarchy, messages are not synced."
                        type="checkbox" id="justfolders" name="justfolders"
                    >
                    Just create folders.
                    </label>
                </div>
        
        
                <div>
                        <br>
                </div>

                <div id="button_extra_param" class="text-center scripton">
                        <button type="button" class="btn btn-default btn-block" data-toggle="collapse" 
                        data-target=".extra_param">Show / Hide extra parameters</button>
                </div>

                <div>
                        <br>
                </div>

                <div id="button_swap" class="text-center scripton">
                        <button type="button" class="btn btn-default btn-block" id="swap">
                        Swap Source <span class="glyphicon glyphicon-transfer"></span> Destination
                        </button>
                        
                </div>
        
                <div>
                        <br>
                </div>

            </div>
            
            
            <div id="account2" class="col-md-5" >
                <fieldset>
                <legend class="text-center h2">IMAP destination Mailbox</legend>

                <label for="user2">Login</label> (usually an email address)
                <div class="input-group form-group">
                    <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
                    <input
                        data-toggle="tooltip" data-placement="bottom" title="It is usually an email address or its left part before @"
                        type="text" class="form-control input-lg" id="user2" name="user2" tabindex="6"
                        placeholder="Enter login name"
                    >
                </div>
                <label for="password2">Password</label>
                <label class="checkbox-inline out">
                    <input type="checkbox" id="showpassword2"> show password
                </label>
                <div class="input-group form-group">
                    <span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
                    <input
                        data-toggle="tooltip" data-placement="bottom" title="Passwords are not stored on the server"
                        type="password" class="form-control input-lg" id="password2" name="password2" tabindex="7"
                        placeholder="Enter password"
                     >
                </div>

                <label for="host2">IMAP Server hostname</label> (or its IP address)
                <div class="input-group form-group">
                    <span class="input-group-addon"><i class="glyphicon glyphicon-cloud"></i></span>
                    <input
                        data-toggle="tooltip" data-placement="bottom" title="IMAP transfers are done with encryption if the servers support it."
                        list="servers2" type="text" class="form-control input-lg" id="host2" name="host2" tabindex="8"
                        placeholder="Enter IMAP destination server name or IP address"
                     >
                     <datalist id="servers2">
                        <option value="imap.gmail.com">
                        <option value="outlook.office365.com">
                        <option value="imap.hostinger.com">
                        <option value="ssl0.ovh.net">
                        <option value="email-ssl.com.br">
                        <option value="imap.mail.yahoo.com">
                     </datalist>
                </div>
                <!-- --> 
                <div class="form-group collapse extra_param">
                    <label class="checkbox-inline">
                    <input 
                        data-toggle="tooltip" data-placement="bottom" title="Be careful with this option"
                        type="checkbox" id="delete2" name="delete2" tabindex="9"
                    >
                    Strict sync. Deletes messages on destination mailbox that are not at the source mailbox.
                    </label>
                </div>
                
                <div class="form-group collapse extra_param" id="extra_subfolder2" > 
                <label for="subfolder2">Sub-folder</label>
                <div class="input-group form-group">
                    <span class="input-group-addon"><i class="glyphicon glyphicon-folder-open"></i></span>
                    <input
                        data-toggle="tooltip" data-placement="bottom" title="A subfolder where all the source mailbox will go."
                        type="text" class="form-control input-lg" id="subfolder2" name="subfolder2"
                        placeholder="Enter sub-folder name"
                    >
                </div>
                </div>
                
                
                <!-- --> 
                 <div>
                    <br>
                </div>
                </fieldset>
           </div>


            <input
                data-toggle="tooltip" data-placement="bottom" title="Extra parameters like in the imapsync command line."
                type="text" class="form-control input-lg collapse extra_param" id="extra" name="extra"
                placeholder="Enter extra parameters"
            >
        
        </div>

        <input type="hidden" name="automap"   value="on">
        <input type="hidden" name="addheader" value="on">
        <!-- -#->
        <input type="hidden" name="log" value="on">
        <input type="hidden" name="simulong" value="360">
        <input type="hidden" name="exitwhenover" value="3000000000">
        <!-#- -->

        <a id="buttons"></a>
        <br>
        <div class="text-center center-block">
        If you <b>close</b> this <b>window</b> (or this tab) <b>during</b> the synchronization, 
        it will <b>stop</b> the synchronization, it's like <b>hitting</b> the red button <b>"Stop!"</b> below.
        </div>
        <br>
        <!-- Classical button to go to the log only, when javascript is turned off -->
        <noscript>
                <div class="row">
                <div class="col-sm-12 padd0" >
                <button type="submit" class="btn btn-success btn-lg center-block btn-block">Go sync!</button> 
                </div>
                </div>
        </noscript>

        <!-- Javascript buttons using xhr -->
        <div class="row scripton">
            <div class="col-sm-6 padd0" >
            <button id="bt-sync" type="button"
                    class="btn btn-success btn-lg center-block btn-block"
                    tabindex="11"
                    data-toggle="tooltip" data-placement="top" 
                    title="Launch the sync! You can stop the sync with the red Stop! button nearby or by closing the tab/window."
                    >
                Sync or resync!<br>
                <span class="glyphicon glyphicon-envelope"></span>
                <span class="glyphicon glyphicon-arrow-right"></span>
                <span class="glyphicon glyphicon-envelope"></span>
            </button>
            </div>
            <div class="col-sm-6 padd0" >
            <button id="bt-abort" type="button" 
                    class="btn btn-danger btn-lg center-block  btn-block" tabindex="12"
                    data-toggle="tooltip" data-placement="top" 
                    title="Stop the sync! You can restart the sync later, no duplicates should happen."
            >
            Stop!<br>
                <span class="glyphicon glyphicon-scissors"></span>
            </button>
            </div>
        </div>
    </form>

    <div class="row scripton" id="consoles" >

        <pre id="progress-txt">ETA: Estimation Time of Arrival</pre>

        <div class="progress">
                <div id="progress-bar-done" class="progress-bar progress-bar-success" role="progressbar">
                Progress bar 
                </div>
                <div id="progress-bar-left" class="progress-bar progress-bar-info" role="progressbar">
                Progress bar
                </div>
        </div>

        <div class="col-sm-6 well">
            <h2 class="text-center">Console of imapsync launch</h2>
            <pre id="console">



            </pre>

        </div>

        <div class="col-sm-6 well">
            <h2 class="text-center">Console of Stopping</h2>
            <pre id="abort">



            </pre>
        </div>
    </div>

</div>

<h2 id="imapsync_log_beginning" class="text-center scripton">Log of imapsync run</h2>
<div class="text-center scripton">
<a href="#imapsync_log_bottom">Link to the <b>bottom</b> of the imapsync log file</a>
</div>

<pre id="output" class="scripton">


















</pre>

<div id="imapsync_log_bottom" class="text-center scripton">
<a href="#imapsync_log_beginning">Link to the <b>beginning</b> of the imapsync log file</a>
</div>

<a id="bottom"></a>
<hr>

    <p class="text-center">Feel free to contact 
    <strong><a  href="https://imapsync.lamiral.info/#AUTHOR" target="_blank">Gilles LAMIRAL</a></strong>
    </p>

<div class="container-fluid" >
    <div class="row">
        <div class="text-center">
            <a href="https://imapsync.lamiral.info/">
                <img alt="Imapsync home page" src="https://imapsync.lamiral.info/X/logo_imapsync_Xn.png" height="38" width="60">
            </a>
            <a href="#top" title="Top of the page" class="btn btn-info " role="button">Top</a>
            <!-- <a href="#buttons"  class="btn btn-info scripton" role="button">Consoles</a> -->
            <a href="#bottom" title="Bottom of the page" class="btn btn-info active" role="button">Bottom</a>
            <br>
        <small> ($Id: imapsync_form_extra.html,v 1.35 2024/08/06 18:43:50 gilles Exp gilles $) </small><br>
        Terms and conditions for anything: <a href="https://imapsync.lamiral.info/LICENSE">No limits to do anything with this work and this license!</a><br>
        </div>
    </div>
</div>

<script 
src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"
integrity="sha384-xBuQ/xzmlsLoJpyjoggmTEz8OWUFM0/RC5BsqQBDX2v5cMvDHcMakNTNrHIW2I5f"
crossorigin="anonymous"
>
</script>

<script 
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" 
crossorigin="anonymous"
>
</script>

<!--
<script src="crypto-js/core.js"></script>
<script src="crypto-js/sha256.js"></script>
-->

<script
src="imapsync_form.js"
type="text/javascript"
>
</script>

</body>
</html>


That said, if you’re not going to update it, just remove that mount path and let the image use its default

How do I link it with volumes, I can’t find the file in any paths ?

This container has been somewhat frustrating to get working. In the case of the HTML file; I can’t find it anywhere. I’ve searched all paths and found nothing ?

I don’t think I understand you
What are you trying to achieve?

When you use a mount path, you do so in order to either keep a directory for persistent storage, or to override files with your own

The mount paths are writtenwith the following syntax:
/host/mount/path:/contianer/mount/path[:permissions]

Your first mount path means the following:

Take the file I have prepared in the path /usr/bin/imapsync/imapsync_form-_extra.html on my computer, and put it inside the container, at /var/tmp/imapsync_form-_extra.html

So, unless you have your own custom HTML you want to mount into the container, you should probably just remove that mount, and use the one provided with the image itself

I’m trying to find this imapsync_form_extra.html file. I’ve searched within user paths etc unable to find. So that I can use this default html file, before if ever creating my own.

Just remove the mount and the image will use its own default file, remove the mount

imapsync:
    container_name: imapsync
    ports: 
    - 12580:8080 
    restart: unless-stopped
    image: gilleslamiral/imapsync
    volumes:
        - /usr/bin/imapsync_cgi:/var/tmp/imapsync_cgi
1 Like

I removed the volume and all arrays. Although, the container starts then stops. I understand it’s something you run once but for now I’d like to keep it running ?

I don’t really know what this container is or does, and how it’s intended to be used, so I can’t really answer that

I can only suggest you go to the source for this container and read the usage manual

Make sure it starts a forever running foreground process.

You might want to research and learn about the filesystem layout on Linux, especially on an appliance style OS like your NAS uses. The host path /usr/bin is definitely not the right location and might not survive DSM updates… On a Syno, persistent data belongs underneath the host path /volumeX.

If you want the container to persist data on the host, you will need to map a directory into a container directory.

Generally, it looks like you lack a basic understanding of how docker works.
Recommended links to learn the basics and concepts: