Can't create Grafana container

  • Hi,


    I'm tried several attempts to create Grafana, but failed.
    Grafana is currently own by root:root.



    permissions:


    Error:

    Code
    Failure
    OCI runtime create failed: container_linux.go:346: starting container process caused "chdir to cwd (\"/usr/share/grafana\") set in config.json failed: permission denied": unknown

    OMV v5.0
    Asus Z97-A/3.1; i3-4370
    32GB RAM Corsair Vengeance Pro

  • All I had to do was run this in the shell:


    Code
    docker run -d --name=grafana -p 3000:3000 grafana/grafana

    It was up and running on port 3000.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • Well, you can use Portainer if you wish. But guess what? If you run the command I posted, the image will be pulled, the container created, and it will just work. And if you want to see it in Portainer, just look and see. Portainer is aware of all your containers, even if you didn't use Portainer to create them.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • I tried your method, but error persist>


    Code
    sudo docker run -d --name=grafana -p 3000:3000 grafana/grafana
    a14cffd5121055cc7ec110898fd96f44ceb3b74d6f999680279c5dfc03d0a1d6
    docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "chdir to cwd (\"/usr/share/grafana\") set in config.json failed: permission denied": unknown.

    OMV v5.0
    Asus Z97-A/3.1; i3-4370
    32GB RAM Corsair Vengeance Pro

  • Why are you running docker commands with elevated (root) privileges? That is not a good idea, even if it did work.


    You should have an ordinary user on your system and all your dockers should be running as that user and group.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • Shouldn't matter? That remains to be seen.


    Do you have any other ordinary users on the system? If not, then create one, and give it bash for the shell. Log in and try again.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • I'm stumped. I had it running seconds after executing that command.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

    • Offizieller Beitrag

    Docker-run worked for me as well... Just for grins, also wrote a quick docker-compose, which also worked fine in my virtual machine.




    Code
    version: "2"
    services:
      grafana:
        image: grafana/grafana:latest
        container_name: grafana
        environment:
          - GF_SECURITY_ADMIN_PASSWORD=secret
        ports:
          - 3000:3000
        restart: unless-stopped

    It did take about 25sec to start, logs seemed it was creating a bunch of stuff... but once done, I went to the serverip:3000 and logged in w/o issue.

    • Offizieller Beitrag

    Did you run docker-compose as root? I never do.


    Try this.


    In Portainer... On the left, click Stacks


    Add Stack


    At the top name the stack (grafana)


    Copy/paste that docker-compose I put above (just that) in the box below.


    Click deploy stack.


    If two or three of us have done this no problem, there's something you're doing that I can't figure out.

  • The stack deploys properly, as did my docker run command.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

    • Offizieller Beitrag

    The stack deploys properly, as did my docker run command.

    Yep, it worked for me as well... I've just become kind of a docker-compose/stack addict... :). So even if I see a docker run command that works as this one did, I rewrite it to docker-compose, then back it up to make a container easy to redeploy if I reinstall.

Jetzt mitmachen!

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