Docker version difference

We were try to excecute docker command from command option in aikaan.
command: docker system prune -a --volumes -f
but gives following error

then we check docker version from terminal so it gives correct version which is installed in device

but from command option it gives different output

Can you help us to resolve the error.

Hi @kishan

The command execution does not add any additional environment. It just passes the text to the shell interpreter. If it does not work on the shell, it can not work on the command option.

To confirm, can you please try running the command “docker image remove” on the terminal and check the results?

Thanks
C

on the terminal, it is working fine. but in the command menu, it is not working. also as you can see docker version is completely different. you can compare both the screenshot for refrence also screenshots are from one device at the same time.

Hi @kishan ,

Docker API version is environment-dependent. The command execution is executed as ‘root’ user on your device. If your device has multiple docker installations or set up the DOCKER_API_VERSION to 1.20 it might end up using an older version.

Try this in your command execution

DOCKER_API_VERSION=1.21 docker version

If the above works, you run a command to remove the image as follows

DOCKER_API_VERSION=1.21 docker remove image

Thanks
C

1 Like

thanks alot
that worked
we used this command from command menu to remove all unused images
DOCKER_API_VERSION=1.40 docker system prune -a --volumes -f

1 Like