Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker image: exec: "/bin/sh": stat /bin/sh: no such file or directory: unknown #1319

Closed
src386 opened this issue Jan 20, 2021 · 4 comments
Closed

Comments

@src386
Copy link

src386 commented Jan 20, 2021

It seems like it is currently not possible to build any Docker images FROM balthek/zola.

Dockerfile:

FROM balthek/zola:0.13.0 AS builder
COPY . .
RUN zola build

FROM nginx:latest
COPY --from=builder /workdir .

Build:

$ docker build -t mycustomimage .
Sending build context to Docker daemon  73.65MB
Step 1/5 : FROM balthek/zola:0.13.0 AS builder
 ---> 59e24c2db347
Step 2/5 : COPY . .
 ---> 1bc09f3100c4
Step 3/5 : RUN zola build
 ---> Running in 8b4ab29b3984
OCI runtime create failed: container_linux.go:370: starting container process caused: exec: "/bin/sh": stat /bin/sh: no such file or directory: unknown

The balthek/zola image uses FROM: scratchas a base layer :

FROM scratch
so there is no shell, no binary, nothing except zola. It is possible to use docker run with volume mounts to execute zola, but it is currently not possible to build another image based on balthek/zola.

@src386
Copy link
Author

src386 commented Jan 20, 2021

Workaround:

FROM debian:buster-slim
COPY --from=balthek/zola:0.13.0 /usr/bin/zola /usr/bin/zola
ADD . .
RUN zola build

@Keats
Copy link
Collaborator

Keats commented Jan 20, 2021

Isn't that the point of a Docker image for a specific tool? The leanest possible and you can still COPY if needed.

@src386
Copy link
Author

src386 commented Jan 20, 2021

Isn't that the point of a Docker image for a specific tool? The leanest possible and you can still COPY if needed.

IMO scratch based images are a pain because it makes troubleshoot harder when something does not work.

The workaround is good enough for me so I will close this issue.

@oleastre
Copy link
Contributor

For info, there is now an example how to use the zola image in a multi stage build without any work around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants