Search code examples
macosdockerdocker-run

How to launch graphite docker container locally?


I am following this wiki to setup some performance numbers for my testing I am doing. I needed to setup graphite to see my numbers.

So I ran this command as mentioned in the wiki on my mac -

docker run -d --name graphite -p 80:80 -p 2003-2004:2003-2004 -p 2023-2024:2023-2024 -p 8125:8125/udp -p 8126:8126 graphiteapp/graphite-statsd

Below is what I got:

> docker run -d --name graphite -p 80:80 -p 2003-2004:2003-2004 -p 2023-2024:2023-2024 -p 8125:8125/udp -p 8126:8126 graphiteapp/graphite-statsd
Unable to find image 'graphiteapp/graphite-statsd:latest' locally
latest: Pulling from graphiteapp/graphite-statsd
aad63a933944: Pull complete
9b6d24804914: Pull complete
5f9542cd4cb1: Pull complete
09c978daf42b: Pull complete
Digest: sha256:18fbffd024cd540c7a57febfaa38c3dc5513f05db2263300209deb2a8ecd923c
Status: Downloaded newer image for graphiteapp/graphite-statsd:latest
ac248794f9cdea3bd1ab65659ec321d0aa0111de3f151c5e206b6503202a35e3

Now I ran my program which is pushing my metrics to graphite and then I was trying to configure my grafana dashboard by launching grafana docker container with below command as shown in that same wiki:

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

But I got an error once I executed above command:

> docker run -d --name -p 3000:3000 grafana grafana/grafana

Unable to find image '3000:3000' locally
docker: Error response from daemon: pull access denied for 3000, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.

This is the first time I am working with docker so have some issues setting it up and I have already installed docker on my mac. Any idea what is wrong here?


Solution

  • To explain the problem in your command.

    Your command

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

    As you can see, --name, no value is specified and that's why it is picking up random value for the image. Use the below command. Meaning of the flags are

    • --name => Name of the container which is grafana in this case
    • -p => Publish a container's port(s) to the host, which is 3000:3000 over here
    • -d => Run container in background and print container ID
    docker run -d -p 3000:3000 --name grafana grafana/grafana
    

    Logs of the command:

    docker run -d -p 3000:3000 --name grafana grafana/grafana
    Unable to find image 'grafana/grafana:latest' locally
    latest: Pulling from grafana/grafana
    cbdbe7a5bc2a: Already exists
    ed18d4ca725a: Pull complete
    5ac007dea7db: Pull complete
    33b8e7fbf663: Pull complete
    09cd2fb04616: Pull complete
    990c0b335bdb: Pull complete
    Digest: sha256:4bbfcbf9372e1022bf51b35ec1aaab04bf46e01b76a1d00b424f45b63cf90967
    Status: Downloaded newer image for grafana/grafana:latest
    7748b112f5004a18144152ac7330749b83120914bb0ab0d3a7112ea16368bfa2