View existing docker container command

Hi guys,

I know this isn’t strictly a storj node issue, however I was wondering if someone could tell me if there’s a command I can run on docker which will tell me the current run command running against the storj node container?

Ive done a bit of googling and can’t find anything…

Basically i want to check the run command each container is running with to make sure i don’t need to correct anything etc. It would also save me having to keep a separate record of each container config for each machine I have docker running on.


You can check all the parameters using

docker inspect storagenode


docker inspect storagenode -f “{{ .Config.Env }}”


You should look into using docker-compose for managing your containers

thanks but this doesn’t give me the command i run, it just gives me the details scattered about in some kind of config. Its still better than nothing tho!

thanks, looks complicated! ill do some googling and see how it works.

It doesn’t really:

And the live:

  • To run:
docker-compose up -d
  • To stop:
docker-compose stop <containername>

for the live example:

docker-compose stop storagenode-Node1
  • To start
docker-compose start <containername>

for the live example:

docker-compose start storagenode-Node1
  • To remove
docker-compose down
  • To manually update:
docker-compose pull
docker-compose up -d

What are you missing from docker inspect storagenode? According to the docs the docker command should be

docker run -d --restart unless-stopped --stop-timeout 300 \
    -p 28967:28967 \
    -p \
    -e EMAIL="" \
    -e ADDRESS="" \
    -e STORAGE="2TB" \
    --mount type=bind,source="<identity-dir>",destination=/app/identity \
    --mount type=bind,source="<storage-dir>",destination=/app/config \
    --name storagenode storjlabs/storagenode:latest

Just replace the variable parts with the output from docker inspect storagenode. In the future, write your docker command in a script and then start that script. That way you always know what your command was.


On my Ubuntu system …

cat .bash_history
1 Like

or even better grep "docker" .bash_history

1 Like

history | grep “Whatever you want to look at”

eg: history | grep “docker run”