Home > Net >  Docker commands (command not found)
Docker commands (command not found)

Time:11-26

If I use docker commands in terminal all ok, but in script do not working. enter image description here enter image description here Please help!

I added - PATH="/usr/bin:$PATH" and PATH="/var/lib/docker:$PATH" but...

CodePudding user response:

Unless you want to save output of "docker ps" and "docker images" in a variable, you should just run those commands directly in the script as follows. No need to use backticks or $() for that.

#!/bin/bash
docker ps
docker images
  • Related