2

While trying to run a docker image. I am getting the following error.

/usr/local/bin/docker-entrypoint.sh: line 46: cat: command not found

Am I missing something to add to the image while building it? What could be the issue?

Here is the Dockerfile

FROM scratch # new image LABEL docker-slim.version=linux|Transformer|1.36.4|8e0e0a59720bb95c708c046cf9ec71b4939803da|2021-09-07_08:07:15AM ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ENV GOSU_VERSION=1.7 ENV MYSQL_MAJOR=5.7 ENV MYSQL_VERSION=5.7.17-1debian8 VOLUME [/var/lib/mysql] ADD file:931d8c01612b2bf01443d3141de5c0899c7346c0167a9dc0c1da3ec194a0665c / EXPOSE 3306/tcp ENTRYPOINT ["docker-entrypoint.sh"] CMD ["mysqld"] # end of image: (id: tags: )``` 
2
  • 1
    What is in the file you ADD? Commented Sep 18, 2021 at 6:45
  • scratch is an empty image. Perhaps you should use busybox instead which provides all the basic utilities and has a very small footprint. Commented Sep 25, 2021 at 12:52

1 Answer 1

6

FROM scratch means 'start from an empty directory'. There is no cat inside, unless explicitly added it. One way to do that is to copy the binary from another image:

FROM debian:buster as cat_source FROM scratch COPY --from=cat_source /bin/cat /bin/cat # the rest of the dockerfile ... 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.