Chase AdamsChase Adams
AboutContentPromptsPlayground

'Fix Docker Error: exec user process caused "no such file or directory"'

Essays and updates on product, engineering, and AI by Chase Adams.

1 minute read

If you've ever received a Docker error for "no such file or directory", this is a possible solution.

Error

standard_init_linux.go:207: exec user process caused "no such file or directory"

Solution

Make sure all of the scripts that are being run in the container (this is especially true for entrypoint.sh) are using a process that exists.

If it is an entrypoint.sh, you probably need to make sure to do this:

- #!/bin/bash
+ #!/bin/sh

If you need bash features, use an Alpine distro with bash already installed or install it in the Dockerfile.

When Do I See It Most?

When I'm using Docker and the Dockerfile is alpine linux, I sometimes forget that it doesn't have bash installed and accidentally add the sha-bang for #!/bin/bash. 99.9% of the time that's okay, so I change it to #!/bin/sh.

This is especially true when I'm making a GitHub Action.

First Cohort
No Coding Experience Required

Build Your Website with AI—No Code Required

Learn to create and deploy professional websites using ChatGPT and Claude. Go from complete beginner to confident website builder.

Start Building Today

Post Details

Published
Apr 1, 2019
Category
Engineering
Share
Ask ChatGPT
Ask Claude

Similar Posts

Fix Docker Error: Failed Port Allocation

Fix Docker Error: Failed Port Allocation

in Docker

AboutAI Workflow SpecContentStacksNewsletterPromptsRSS

Ask me anything

Loading...

Hi! Ask me anything about Chase's work.

I can answer questions based on his blog posts and articles.

Experimental: This chat is a side project I work on in my free time. Responses may vary in quality and accuracy.