mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
Docker: update the docker file and add .dockerignore
simplify the contenair Correctly install the STM toolchain and ccache Add bash completion
This commit is contained in:
parent
ced185b59b
commit
05f8d7647a
29
.dockerignore
Normal file
29
.dockerignore
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# Docker context ignore list
|
||||||
|
.azure
|
||||||
|
.github
|
||||||
|
.git
|
||||||
|
.idea
|
||||||
|
.vagrant
|
||||||
|
AntennaTracker
|
||||||
|
Rover
|
||||||
|
ArduCopter
|
||||||
|
ArduPlane
|
||||||
|
ArduSub
|
||||||
|
benchmarks
|
||||||
|
build
|
||||||
|
docs
|
||||||
|
libraries
|
||||||
|
mk
|
||||||
|
modules
|
||||||
|
tests
|
||||||
|
Tools
|
||||||
|
# autotest directories
|
||||||
|
test.?
|
||||||
|
terrain
|
||||||
|
logs
|
||||||
|
# mavproxy stuff
|
||||||
|
mav.*
|
||||||
|
|
||||||
|
# include the setup script and completion
|
||||||
|
!Tools/environment_install/install-prereqs-ubuntu.sh
|
||||||
|
!Tools/completion
|
29
Dockerfile
29
Dockerfile
@ -1,17 +1,19 @@
|
|||||||
FROM ubuntu:16.04
|
FROM ubuntu:18.04
|
||||||
WORKDIR /ardupilot
|
WORKDIR /ardupilot
|
||||||
|
|
||||||
RUN useradd -U -d /ardupilot ardupilot && \
|
RUN useradd -U -m ardupilot && \
|
||||||
usermod -G users ardupilot
|
usermod -G users ardupilot
|
||||||
|
|
||||||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install --no-install-recommends -y \
|
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install --no-install-recommends -y \
|
||||||
lsb-release \
|
lsb-release \
|
||||||
sudo \
|
sudo \
|
||||||
software-properties-common \
|
software-properties-common
|
||||||
python-software-properties
|
|
||||||
|
|
||||||
|
COPY Tools/environment_install/install-prereqs-ubuntu.sh /ardupilot/Tools/environment_install/
|
||||||
|
COPY Tools/completion /ardupilot/Tools/completion/
|
||||||
|
|
||||||
|
# Create non root user for pip
|
||||||
ENV USER=ardupilot
|
ENV USER=ardupilot
|
||||||
ADD . /ardupilot
|
|
||||||
|
|
||||||
RUN echo "ardupilot ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/ardupilot
|
RUN echo "ardupilot ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/ardupilot
|
||||||
RUN chmod 0440 /etc/sudoers.d/ardupilot
|
RUN chmod 0440 /etc/sudoers.d/ardupilot
|
||||||
@ -19,11 +21,18 @@ RUN chmod 0440 /etc/sudoers.d/ardupilot
|
|||||||
RUN chown -R ardupilot:ardupilot /ardupilot
|
RUN chown -R ardupilot:ardupilot /ardupilot
|
||||||
|
|
||||||
USER ardupilot
|
USER ardupilot
|
||||||
RUN bash -c "Tools/environment_install/install-prereqs-ubuntu.sh -y"
|
|
||||||
RUN sudo apt-get clean \
|
ENV SKIP_AP_EXT_ENV=1 SKIP_AP_GRAPHIC_ENV=1 SKIP_AP_COV_ENV=1 SKIP_AP_GIT_CHECK=1
|
||||||
|
RUN Tools/environment_install/install-prereqs-ubuntu.sh -y
|
||||||
|
|
||||||
|
# add waf alias to ardupilot waf to .bashrc
|
||||||
|
RUN echo "alias waf=\"/ardupilot/waf\"" >> ~/.bashrc
|
||||||
|
|
||||||
|
# Check that local/bin are in PATH for pip --user installed package
|
||||||
|
RUN echo "if [ -d \"\$HOME/.local/bin\" ] ; then\nPATH=\"\$HOME/.local/bin:\$PATH\"\nfi" >> ~/.bashrc
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
RUN DEBIAN_FRONTEND=noninteractive sudo apt-get clean \
|
||||||
&& sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
&& sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
ENV CCACHE_MAXSIZE=1G
|
ENV CCACHE_MAXSIZE=1G
|
||||||
ENV PATH /usr/lib/ccache:/ardupilot/Tools:${PATH}
|
|
||||||
ENV PATH /ardupilot/Tools/autotest:${PATH}
|
|
||||||
ENV PATH /ardupilot/.local/bin:$PATH
|
|
||||||
|
Loading…
Reference in New Issue
Block a user