RUN
commands DOK-W1001RUN
instructions. Consider consolidation.48
49# Set Ownership of Autonomy Software
50RUN chown docker -R /usr/local/zed
51RUN chown docker -R /usr/local/cuda52
53# Add over the start.sh script
54ADD scripts/start.sh start.sh
RUN
instructions. Consider consolidation.47RUN rm -rf /opt/Autonomy_Software
48
49# Set Ownership of Autonomy Software
50RUN chown docker -R /usr/local/zed51RUN chown docker -R /usr/local/cuda
52
53# Add over the start.sh script
RUN
instructions. Consider consolidation.48
49# Set Ownership of Autonomy Software
50RUN chown docker -R /usr/local/zed
51RUN chown docker -R /usr/local/cuda52
53# Add over the start.sh script
54ADD scripts/start.sh start.sh
RUN
instructions. Consider consolidation.47RUN rm -rf /opt/Autonomy_Software
48
49# Set Ownership of Autonomy Software
50RUN chown docker -R /usr/local/zed51RUN chown docker -R /usr/local/cuda
52
53# Add over the start.sh script
RUN
instructions. Consider consolidation.122RUN echo 'export MAKEFLAGS=-j$(($(grep -c "^processor" /proc/cpuinfo) - 1))' >> .bashrc
123
124# Clone Autonomy Software Repository
125RUN git clone --recurse-submodules -j8 https://github.com/MissouriMRDT/Autonomy_Software.git /opt/Autonomy_Software126
127# Set Working Directory
128WORKDIR /opt/Autonomy_Software/
Each RUN
instruction will create a new layer in the resulting image. Therefore squashing consecutive RUN
instructions will reduce the layer count (see https://docs.docker.com/develop/dev-best-practices/).
In addition to that, each RUN
instruction runs in its own shell, which can be the source of confusion when part of a RUN
instruction changes something about the environment, because these changes may vanish in the next RUN
instruction.
RUN command1
RUN command2
In general you want layers first which don't change often, so they can be cached. Putting easy cacheable and non-cacheable commands in the same layer (by using one RUN command) might have negative performance issues. If you are aware of this, and this is a design decision, you can safely ignore this issue.
RUN command1 && \
command2