Я пытаюсь использовать Docker с моим macOS Catalina v10.15.4
Когда я пытался RUN ./test.sh
в Dockerfile, и произошла какая-то ошибка.
Это мой Dockerfile:
FROM ubuntu:18.04
RUN mkdir -p /home/rootfs/src
COPY test.sh /home/rootfs
WORKDIR /home/rootfs
RUN chmod +x test.sh && ./test.sh
Когда я пытался построить это, он не нашел следующий скрипт:
$ docker build -t test .
Sending build context to Docker daemon 264.6MB
Step 1/5 : FROM ubuntu:18.04
---> 4e5021d210f6
Step 2/5 : RUN mkdir -p /home/rootfs/src
---> Running in d0813632475d
Removing intermediate container d0813632475d
---> 87a6e284993d
Step 3/5 : COPY test.sh /home/rootfs
---> 26d281d0002c
Step 4/5 : WORKDIR /home/rootfs
---> Running in 4c7e81a514a7
Removing intermediate container 4c7e81a514a7
---> dab2872eb15a
Step 5/5 : RUN chmod +x test.sh && ./test.sh
---> Running in a03f3e5d29b4
/bin/sh: 1: ./test.sh: not found
The command '/bin/sh -c chmod +x test.sh && ./test.sh' returned a non-zero code: 127
Я проверяю информацию о тесте. sh file test.sh
в macOS.
Получил это:
test.sh: POSIX shell script text executable, ASCII text, with CRLF line terminators