CodexBloom - Programming Q&A Platform

Ubuntu 20.04 - Docker Container scenarios to Start with 'standard_init_linux.go:211: starting container process caused' scenarios

👀 Views: 85 💬 Answers: 1 📅 Created: 2025-06-08
docker ubuntu linux bash

I'm deploying to production and I'm collaborating on a project where I'm stuck on something that should probably be simple... I'm running Docker on Ubuntu 20.04 and I've encountered a frustrating scenario when trying to start one of my containers. The command I use to start the container is: ```bash docker run -d --name myapp -p 8080:80 myapp-image ``` However, the container fails to start, and I receive the following behavior message in the logs: ``` standard_init_linux.go:211: starting container process caused "exec: \"/app/start.sh\": permission denied" ``` I’ve checked the permissions of the `start.sh` script inside the image, and it’s set to executable: ```bash ls -l /app/start.sh ``` This returns: ``` -rwxr-xr-x 1 root root 1234 Oct 1 12:00 /app/start.sh ``` I also ensured that the file is located in the correct directory within the container. I’ve tried running the container with elevated privileges by adding the `--privileged` flag, but that didn’t resolve the scenario. Additionally, I've looked at the Dockerfile used to build the image, which is as follows: ```dockerfile FROM ubuntu:20.04 COPY start.sh /app/start.sh RUN chmod +x /app/start.sh CMD ["/app/start.sh"] ``` The same Dockerfile works perfectly on another machine running a different Linux distribution. I suspect it might be related to AppArmor or some security feature in Ubuntu affecting the container, but I can’t pinpoint the cause. I’ve also tried disabling AppArmor entirely using: ```bash sudo systemctl stop apparmor ``` but the scenario continues. Any insights or suggestions on what might be causing this 'permission denied' behavior would be greatly appreciated! What's the best practice here? Any ideas how to fix this? This is part of a larger mobile app I'm building. Any ideas what could be causing this?