Docker container images installation help

  • Soma


    Thank you for time and understanding,

    I have followed videos and read and have some understanding what is required but obviously not enough as i have used root. I will follow you guide and hopefully i will succeed.

  • So when I create a folder ~/tmp/config with the conf file in it and run docker run -it -p 1883:1883 -p 9001:9001 -v ~/tmp/config:/mosquitto/config -v /mosquitto/data -v /mosquitto/log eclipse-mosquitto all is working.

  • Thanks to you both, comments are not hash, the only thing i can say as newbie is we t and you get over whelmed . This when some help from guys like you comes in. Now i know that i need a user name in the docker group i can hopefully go on from here.


    thanks again.

  • So when I create a folder ~/tmp/config with the conf file in it and run docker run -it -p 1883:1883 -p 9001:9001 -v ~/tmp/config:/mosquitto/config -v /mosquitto/data -v /mosquitto/log eclipse-mosquitto all is working.

    Well, too many ways to "kill a mosquitto", :D (pun intended) ;)



    Thanks to you both, comments are not hash, the only thing i can say as newbie is we t and you get over whelmed . This when some help from guys like you comes in. Now i know that i need a user name in the docker group i can hopefully go on from here.

    The reason to have a dedicated user for docker is for safety. It's not really "demanding".

    But, with an "unpriviledge" user, even if there's a "hole", that user won't be able to have much access to the system.


    Just take your time and go step by step.


    I'll also try to make this into a ".yml" file to be more easy to deploy on Portainer or with "docker-compose"


    If you have any hiccups, just post it and we'll go from there.

    • Offizieller Beitrag

    I don't have a dedicated user for docker, but my user that I added to the docker group and runs my docker stuff does not have sudo or any other elevated privileges. It's just my main user..


    I agree w/ you though on the need for an unprivileged user to be running containers.

  • I don't have a dedicated user for docker, but my user that I added to the docker group and runs my docker stuff does not have sudo or any other elevated privileges. It's just my main user..

    Yep, I also have my "regular" user added to the docker group (not a exclusive one) but with the same principle: no sudo or other elevated priviledges. :)

  • Hi

    I have followed the install steps to create a user in docker group. this i found already exist, so i added my user name. Then logged out of Terminal to log back in for step to to go to /home/user. this is were the confusion sets in.

    I ssh into OMV thru PI or Mike @192.168 ( relevant password) i would normally cd to the relevant file , however this has proved to be incorrect.


    I am struggling on how to get to the docker cd /home/ user to complete the process. Again after looking thru countless pages on the web & docker i am afraid i am getting nowhere. I know that username is registered in sudo.docker group see below.


    I appreciate that i will be frustrating for you to after nurse me thru this but once it in its in? ( well this procedure anyway).



    Code
    <img src="https://forum.openmediavault.org/wsc/index.php?attachment/19714-screenshot-2021-05-05-at-09-56-05-png/&thumbnail=1" class="woltlabAttachment" data-attachment-id="19714" id="wcfImgAttachment0">
  • I don't have a dedicated user for docker, but my user that I added to the docker group and runs my docker stuff does not have sudo or any other elevated privileges. It's just my main user..


    I agree w/ you though on the need for an unprivileged user to be running containers.


    Yep, I also have my "regular" user added to the docker group (not a exclusive one) but with the same principle: no sudo or other elevated priviledges. :)


    Please be aware that a user with control over the docker daemon (aka in the docker group) effectively has elevated privileges due to the capabilities of the docker daemon.


    https://docs.docker.com/engine/security/

  • log back in for step to to go to /home/user. this is were the confusion sets in

    When you login with a user, you're already at "/home/<username>"

    You can see it with this as soon as you login: pwd


    That's where I was guiding you to do the folders (dir).

  • Soma

    sorry but i have an error Unable to open Mosquitto config / mosquitto.conf



    Code
    $ docker run -it --name mosquitto -p 1883:1883 -v/home/mike/docker-mosquitto/mosquitto/config:/mosquitto/config/ -v /home/mike/docker-mosquitto/mosquitto/data:/mosquitto/data/ -v /home/mike/docker-mosquitto/mosquitto/log:/mosquitto/log/ eclipse-mosquitto
    1620220756: Error: Unable to open config file /mosquitto/config/mosquitto.conf.
    $ nano
    $ nano mosquitto/config/mosquitto.conf
    $ docker run -it --name mosquitto -p 1883:1883 -v/home/mike/docker-mosquitto/mosquitto/config:/mosquitto/config/ -v /home/mike/docker-mosquitto/mosquitto/data:/mosquitto/data/ -v /home/mike/docker-mosquitto/mosquitto/log:/mosquitto/log/ eclipse-mosquitto
    docker: Error response from daemon: Conflict. The container name "/mosquitto" is already in use by container "793027bfd1ca8cea6a4d33f71aee6985f8bd5d21cf49d972e44320b2024398b6". You have to remove (or rename) that container to be able to reuse that name.
    See 'docker run --help'.
    $ 

    I checked the nano mosquitto./config/mosquitto.conf it is fine, as you can see i tried again to load it?

    I check the nano conf it was

  • -it --name mosquitto -p 1883:1883 -v/home/mike/docker-mosqui

    You missed a SPACE between -v AND /home.... ;)


    Can you show the output of: cat /home/mike/docker-mosquitto/mosquitto/config/mosquitto.conf???


    As for the error that it's already running: docker stop mosquitto && docker rm mosquitto before running again the container.

  • Somo


    Tried Cat no such file or directory see below



    Code
    $ cat /home/mike/docker-mosquitto/mosquitto/config/mosquitto.conf
    cat: /home/mike/docker-mosquitto/mosquitto/config/mosquitto.conf: No such file or directory
    $ docker run -it --name mosquitto -p 1883:1883 -v /home/mike/docker-mosquitto/mosquitto/config:/mosquitto/config/ -v /home/mike/docker-mosquitto/mosquitto/data:/mosquitto/data/ -v /home/mike/docker-mosquitto/mosquitto/log:/mosquitto/log/ eclipse-mosquitto
    1620222691: Error: Unable to open config file /mosquitto/config/mosquitto.conf.
    $ docker stop mosquitto && docker rm mosquitto
    mosquitto
    mosquitto
  • Code
    ls -al /home/mike/docker-mosquitto/mosquitto.config       
    ls: cannot access '/home/mike/docker-mosquitto/mosquitto.config': No such file or directory

    it looks as though i am not in the incorrect directory

  • ls -al /home/mike/docker-mosquitto/mosquitto/config <<<<<----- This the command I gave you



    ls -al /home/mike/docker-mosquitto/mosquitto.config

    You're putting a DOT . where it's a SLASH /

  • Just a remark: you're logged as "mike", correct???


    Ok, now run nano /home/mike/docker-mosquitto/mosquitto/config/mosquitto.conf


    And then copy/paste this:

    Code
    # following two lines required for > v2.0
    allow_anonymous true
    listener 1883
    persistence true
    persistence_location /mosquitto/data/
    log_dest file /mosquitto/log/mosquitto.log

    Click Ctrl + X and then Y


    Now try again the cat /home/mike/docker-mosquitto/mosquitto/config/mosquitto.conf


    And then run the docker.

  • error in nano Permission denied


    Code
    <img src="https://forum.openmediavault.org/wsc/index.php?attachment/19720-screenshot-2021-05-05-at-16-20-13-png/&thumbnail=1" class="woltlabAttachment" data-attachment-id="19720" id="wcfImgAttachment0">

    I checked to make sure to see which directory i was in and this is mike on my external ssd ?? Does this mean that i have the files on the ssd ?


    $ pwd

    /srv/dev-disk-by-uuid-e67cf220-d53c-4dfc-85db-41d8d6db235c/one/mike/docker-mosquitto

    $

  • I pwd to see which directly i was in and ls result below

    Code
    $ nano /home/mike/docker-mosquitto/mosquitto/config/mosquitto.conf
    $ pwd
    /srv/dev-disk-by-uuid-e67cf220-d53c-4dfc-85db-41d8d6db235c/one/mike/docker-mosquitto
    $ ls  
    mosquitto
    $ ls
    mosquitto
    $    

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!