Closed AlexVanMechelen closed 8 months ago
I removed some of the build steps that caused an error to be able to build a partial container and investigate.
In Dockerfile:
[...] # install analyzers COPY --chown=$USER $FILES/analyzers/* /tmp/analyzers/ #RUN find /tmp/analyzers -type f -executable -exec mv {} $UOPT/bin/ \; \ # && $PBOX setup analyzer # install detectors (including wrapper scripts) COPY --chown=$USER $FILES/detectors/* /tmp/detectors/ #RUN find /tmp/detectors -type f -executable -exec mv {} $UOPT/bin/ \; \ # && find /tmp/detectors -type f -iname '*.txt' -exec mv {} $UOPT/detectors/ \; \ # && $PBOX setup detector # install packers COPY --chown=$USER $FILES/packers/* /tmp/packers/ #RUN $PBOX setup packer # install unpackers #COPY ${FILES}/unpackers/* /tmp/unpackers/ # leave this commented as long as $FILES/unpackers has no file #RUN $PBOX setup unpacker # geenerate Bash completions #COPY --chown=$USER $FILES/utils/_pbox-compgen $UOPT/utils/ #COPY --chown=$USER $FILES/utils/pbox-completions.json $UOPT/utils/ #RUN $UOPT/utils/_pbox-compgen $UOPT/utils/pbox-completions.json -f $HOME/.bash_completion # ---------------------------------------------------------------------------------------------------------------------- RUN find $UOPT/bin -type f -exec chmod +x {} \; ENV UOPT=$UOPT #ENTRYPOINT $UOPT/tools/startup WORKDIR /mnt/share
The container now builds and the file that caused the "not found" error seems to be present
/home/user/.opt/tools/packing-box
The problem however is that this file can't execute. It starts with a shebang line to /bin/bash, and upon testing I can't run /bin/bash either, due to an error in /home/user/.bashrc
bash: /home/user/.bashrc: line 6: syntax error near unexpected token `elif'
'ash: /home/user/.bashrc: line 6: ` elif [ -f /etc/bash_completion ]; then
Don't know why this gives an error, as it seems correct syntax. Commenting it out to see if that fixes the error, a new error occurs.
bash: /home/user/.bashrc: line 13: syntax error near unexpected token `$'{\r''
'ash: /home/user/.bashrc: line 13: ` function command_not_found_handle {
@AlexVanMechelen Thank you for mentioning this. Please provide more information about the environment on which you are trying to build the box (platform, Docker version, etc).
@AlexVanMechelen Your very first error seems to relate to an issue with a COPY in the Dockerfile
when building the box in Windows. The second one indicates an issue with a carriage return (Linux uses newlines \n
and Windows uses CRLF \r\n
) in .bashrc
. If you manage to start the box, you can dos2unix ~/.bashrc
.
@dhondta Both errors are indeed related to the automatic conversion of LF -> CRLF by git. Fixed in #95
Command used
ERROR [framework 10/20]