Notion app logo
Struggling to stay organized and effective? Learn to master your time and tasks with the Effectively Notion course!

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

How to fix the Docker error for exec user process caused "no such file or directory"

2019-04-02

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.

Photo of Chase Adams

Hey, I'm Chase. I help aspiring entrepreneurs and makers turn their ideas into digital products and apps.

Freebies

Vector Arrow Scribbles
banner image for figma vector arrows scribbles

A figma community project of vectorized hand-drawn arrows.

Go To Figma
Vector Line Scribbles
banner for figma vector line scribbles

A figma community project of vectorized hand-drawn lines.

Go To Figma
Vector Shape Scribbles
banner image of figma vector shapes scribbles

A figma community project of vectorized hand-drawn shapes.

Go To Figma

Subscribe to my Newsletter

Every other week I publish the Curiously Crafted newsletter.

In it, I explore the intersection of curiosity and craft: the people who make stuff, what they make and the way they pursue the craft of making.

Online

I'm on almost all social media as @curiouslychase.

The curious logo of Chase Adams: glasses and a bow tie.stay curious.