S
S
semki0962017-04-05 23:08:31
PHP
semki096, 2017-04-05 23:08:31

Why is my code not running in a docker container?

When I run it with my hands in the console, this code works. But if I run it from the controller, it only works for the launch of the container. Entering inside the container and the command to create a folder inside it - does not happen. It's strange that it works manually. Why?

...
shell_exec{'docker run --name my_box -it -d my_image && docker exec -it my_box bash && echo hellou_my_box > my-file.php');
...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lxfr, 2017-04-06
@semki096

1. Does the interpreter that executes the shell_exec command have permission to run docker' images? The user must be a member of the docker group
2. what kind of shell_exec is this from which opera?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question