Docker exec fails, permission denied: unknown
Docker exec fails, permission denied: unknown
I'm new to docker and I'm just trying to create a simple Symfony API. I ran docker-compose up -d which created these containers:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
071de3320346 willdurand/elk "/usr/bin/supervisor…" About a minute ago Up About a minute 0.0.0.0:81->80/tcp simple-api_elk_1
c24132f645be simple-api_nginx "nginx" About a minute ago Up About a minute 0.0.0.0:80->80/tcp, 443/tcp simple-api_nginx_1
37128a03b667 simple-api_php "php-fpm7 -F" About a minute ago Up About a minute 0.0.0.0:9000->9000/tcp simple-api_php_1
aa7738c59891 mysql "docker-entrypoint.s…" About a minute ago Up About a minute 3306/tcp, 33060/tcp, 0.0.0.0:3307->3307/tcp simple-api_db_1
I then took the id from the simple-api_php and ran
docker exec 37128a03b667 composer create-project symfony/website-skeleton symfony-api
docker exec 37128a03b667 composer create-project symfony/website-skeleton symfony-api
It returns:
OCI runtime exec failed: open /tmp/runc-process126262263: permission denied: unknown
here is my docker-compose.travis.yml:
version: '2'
services:
db:
image: mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: symfony
MYSQL_USER: symfony
MYSQL_PASSWORD: symfony
php:
build: ./php-fpm
expose:
- "9000"
volumes:
- ./symfony:/var/www/symfony
- ./logs/symfony:/var/www/symfony/var/logs
links:
- db
nginx:
build: ./nginx
ports:
- "80:80"
links:
- php
volumes_from:
- php
volumes:
- ./logs/nginx/:/var/log/nginx
elk:
image: willdurand/elk
ports:
- "81:80"
volumes:
- ./elk/logstash:/etc/logstash
- ./elk/logstash/patterns:/opt/logstash/patterns
volumes_from:
- php
- nginx
Just don't have enough knowledge to troubleshoot this.
Thanks!!
I second @BentCoder's suggestion. But, generally speaking, in case of an error, why not exec into
bash
and run your command? You will get a complete output...– Jovan Perovic
Sep 3 '18 at 18:04
bash
1 Answer
1
You should edit your elk service.
elk:
image: willdurand/elk
ports:
- "81:80"
volumes:
- ./elk/logstash:/etc/logstash
- ./elk/logstash/patterns:/opt/logstash/patterns <-------- remove this line
volumes_from:
- php
- nginx <-------- remove this line
Note: comments are marked with arrow <------
Also, if you still have the same issue - try to remove images and containers and then rebuild them.
// This command will remove all containers and images in your docker-compose.travis.yml file
$: docker-compose down
// Or you can remove container and images manually
$: docker rm container_name
$: docker rmi image_name
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
There are a lot examples (Symfony specific too) here for you: inanzzz.com/index.php/posts/docker
– BentCoder
Sep 3 '18 at 18:00