Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Dockerfile build fails with source-command not found

I’m trying to build v8 from source using a Dockerfile:

FROM ubuntu:20.04

ARG V8_REPO=https://chromium.googlesource.com/chromium/tools/depot_tools.git
ARG ADD_DEPOTTOOLS2PATH='export PATH=/depot_tools:$PATH'

RUN                                         \
apt-get update -y                        && \
apt-get install git -y                   && \
apt-get install vim -y                   && \
apt-get install wget -y                  && \
apt-get install python3 -y               && \
git clone ${V8_REPO}                     && \
echo ${ADD_DEPOTTOOLS2PATH} >> ~/.bashrc && \
source ~/.bashrc

For some reason, it fails in source-ing .bashrc:

$ docker build --tag host --file .\Dockerfile.txt .
...
#5 47.17 /bin/sh: 1: source: not found
------
executor failed running [... && source ~/.bashrc]: exit code: 127

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The shell which is used by RUN is /bin/sh. /bin/sh does not provide the source command.
Try the .-command instead of source.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading