system('docker version') doesn't return zero

2 visualizaciones (últimos 30 días)
I am trying to use one of the docker functions below for my deployment workflow.
compiler.package.docker
compiler.package.microserviceDockerImage 
compiler.runtime.createDockerImage 
compiler.runtime.createInstallerDockerImage
I run into below error when I run the command:
In order to use <function> you must be able to run in MATLAB: system('docker version') and it should return zero.
When I run "system('docker version')", it returns one and there seems an issue.
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock:
What should I do?

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 4 de En. de 2024
Editada: MathWorks Support Team el 4 de En. de 2024
If you run command "docker version" in terminal, you should get same output as running "system('docker version')". It is not an issue related to MATLAB. 
The error message “permission denied while trying to connect to the Docker daemon socket” usually occurs when the user does not have the necessary permissions to access the Docker daemon socket. To fix the error, you can Create a docker group and add your user to this group. Please refer to this link for detailed instructions Manage Docker as a non-root user. Below is a quick reference.
  • Create the docker group using the following command: sudo groupadd docker
  • Add your user to this group with the following command (assuming adding current user): sudo usermod -aG docker $USER
  • Verify that your user has been added to the docker group by listing the users of the group: groups $USER
  • Log out and log back in again for the changes to take effect.
After following these steps, make sure you don't see any errors when running "docker version" in terminal and you get zero return in MATLAB with "system('docker version')". Then you should be able to use aforementioned docker functions.

Más respuestas (0)

Categorías

Más información sobre Containers en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by