Open Nurech opened 11 months ago
0.484 /usr/bin/env: 'bash\r': No such file or directory
can you check that your git installation isn't changing the newlines to \r\n
?
That's probably not the issue.
Docker is Version 4.22.1 (118664)
C:\Users\xxx\IdeaProjects\sist2>git config core.autocrlf input
/.../
33.19 /usr/bin/env: 'bash\r': No such file or directory
33.19 make[2]: *** [CMakeFiles/before_sist2.dir/build.make:70: CMakeFiles/before_sist2] Error 127
33.19 make[1]: *** [CMakeFiles/Makefile2:227: CMakeFiles/before_sist2.dir/all] Error 2
33.19 make: *** [Makefile:91: all] Error 2
------
Dockerfile:18
--------------------
16 |
17 | RUN mkdir build && cd build && cmake -DSIST_PLATFORM=x64_linux_docker -DSIST_DEBUG_INFO=on -DSIST_DEBUG=off -DBUILD_TESTS=off -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake ..
18 | >>> RUN cd build && make
19 | RUN strip build/sist2 || mv build/sist2_debug build/sist2
20 |
--------------------
ERROR: failed to solve: process "/bin/sh -c cd build && make" did not complete successfully: exit code: 2
✅ I did however override the entrypoint which seemed to work to correct the line endings before the actual build.
Changed Docker file
RUN mkdir build && cd build && cmake -DSIST_PLATFORM=x64_linux_docker -DSIST_DEBUG_INFO=on -DSIST_DEBUG=off -DBUILD_TESTS=off -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake ..
RUN cd build && make -j$(nproc)
RUN strip build/sist2 || mv build/sist2_debug build/sist2
To:
RUN apt-get update && apt-get install -y dos2unix
RUN mkdir build && cd build && cmake -DSIST_PLATFORM=x64_linux_docker -DSIST_DEBUG_INFO=on -DSIST_DEBUG=off -DBUILD_TESTS=off -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake ..
RUN find /build/ -type f -print0 | xargs -0 dos2unix -- || true
RUN cd build && make
RUN strip build/sist2 || mv build/sist2_debug build/sist2
Building was a success.
C:\Users\xxx\IdeaProjects\sist2>docker build . -t my-sist2-image
[+] Building 1744.9s (31/31) FINISHED docker:default
=> [internal] load .dockerignore 0.0s
=> => transferring context: 627B 0.0s
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 3.24kB 0.0s
=> [internal] load metadata for docker.io/library/ubuntu@sha256:965fbcae990b0467ed5657caceaec165018ef44a4d2d46c7cdea80a9dff0d1ea 3.1s
=> [internal] load metadata for docker.io/simon987/sist2-build:latest 3.4s
=> CACHED [stage-1 1/9] FROM docker.io/library/ubuntu@sha256:965fbcae990b0467ed5657caceaec165018ef44a4d2d46c7cdea80a9dff0d1ea 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 32.58kB 0.0s
=> [build 1/16] FROM docker.io/simon987/sist2-build@sha256:f77a113d76862bfc6df8231f25622b2282bd427a932e3502ac93d51f54e3a9e9 0.0s
=> [stage-1 2/9] RUN apt update && DEBIAN_FRONTEND=noninteractive apt install -y curl libasan5 libmagic1 python3 python3-pip git tesseract-ocr && rm -rf /var/lib/apt/lists/* 1649.9s
=> CACHED [build 2/16] WORKDIR /build/ 0.0s
=> CACHED [build 3/16] COPY scripts scripts 0.0s
=> CACHED [build 4/16] COPY schema schema 0.0s
=> CACHED [build 5/16] COPY CMakeLists.txt . 0.0s
=> CACHED [build 6/16] COPY third-party third-party 0.0s
=> CACHED [build 7/16] COPY src src 0.0s
=> CACHED [build 8/16] COPY sist2-vue sist2-vue 0.0s
=> CACHED [build 9/16] COPY sist2-admin sist2-admin 0.0s
=> CACHED [build 10/16] RUN cd sist2-vue/ && npm install && npm run build 0.0s
=> CACHED [build 11/16] RUN cd sist2-admin/frontend/ && npm install && npm run build 0.0s
=> CACHED [build 12/16] RUN apt-get update && apt-get install -y dos2unix 0.0s
=> CACHED [build 13/16] RUN mkdir build && cd build && cmake -DSIST_PLATFORM=x64_linux_docker -DSIST_DEBUG_INFO=on -DSIST_DEBUG=off -DBUILD_TESTS=off -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake .. 0.0s
=> CACHED [build 14/16] RUN find /build/ -type f -print0 | xargs -0 dos2unix -- || true 0.0s
=> CACHED [build 15/16] RUN cd build && make 0.0s
=> CACHED [build 16/16] RUN strip build/sist2 || mv build/sist2_debug build/sist2 0.0s
=> [stage-1 3/9] RUN mkdir -p /usr/share/tessdata && cd /usr/share/tessdata/ && curl -o /usr/share/tesseract-ocr/4.00/tessdata/hin.traineddata https://raw.githubusercontent.com/tesseract-ocr/tessdata/master/hin.traineddata && curl -o /usr/share/tesseract-ocr/4.00/tessdata/jpn.traineddata https://raw.githubuserc 45.6s
=> [stage-1 4/9] COPY --from=build /build/build/sist2 /root/sist2 0.2s
=> [stage-1 5/9] WORKDIR /root/sist2-admin 0.1s
=> [stage-1 6/9] COPY sist2-admin/requirements.txt /root/sist2-admin/ 0.1s
=> [stage-1 7/9] RUN ln /usr/bin/python3 /usr/bin/python 0.5s
=> [stage-1 8/9] RUN python -m pip install --no-cache -r /root/sist2-admin/requirements.txt 38.0s
=> [stage-1 9/9] COPY --from=build /build/sist2-admin/ /root/sist2-admin/ 2.0s
=> exporting to image 4.8s
=> => exporting layers 4.8s
=> => writing image sha256:ccbab7e0b47b5209659e356cabf6bf6feaa6e6dec46e854ee3dc2d616ec811d8 0.0s
=> => naming to docker.io/library/my-sist2-image 0.0s
What's Next?
View summary of image vulnerabilities and recommendations → docker scout quickview
C:\Users\xxx\IdeaProjects\sist2>
Device Information (please complete the following information):
win 10
Docker
Compile from source fails
docker build . -t my-sist2-image