WORKDIR
to switch to a directory DOK-DL3003Only use cd
in a subshell. Most commands can work with absolute paths and in most cases, it is not necessary to change directories. Docker provides the WORKDIR
instruction if you really need to change the current working directory.
Also note that any changes to the environment or working directory within a RUN
command will not stay in effect in subsequent lines.
FROM debian:buster
RUN cd /usr/src/app && git clone [email protected]:lukasmartinelli/hadolint.git
FROM debian:buster
WORKDIR /usr/src/app
RUN git clone [email protected]:lukasmartinelli/hadolint.git