From 2fe3535fd81434dac4146694ed38435e7ed335ec Mon Sep 17 00:00:00 2001 From: Adam Watkins Date: Fri, 17 Nov 2017 13:29:47 -0500 Subject: [PATCH] Docker: add Dockerfile for Docker container support --- Dockerfile | 22 ++++++++++++++++++++++ Tools/scripts/install-prereqs-ubuntu.sh | 4 +++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..65e6567735 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM ubuntu:16.04 +WORKDIR /ardupilot + +RUN useradd -U -d /ardupilot ardupilot && \ + usermod -G users ardupilot + +RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install --no-install-recommends -y \ + lsb-release \ + sudo \ + software-properties-common \ + python-software-properties && \ + apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +ENV USER=ardupilot +ADD . /ardupilot +RUN chown -R ardupilot:ardupilot /ardupilot && \ + bash -c "Tools/scripts/install-prereqs-ubuntu.sh -y && apt-get install gcc-arm-none-eabi -y" && \ + apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +USER ardupilot +ENV CCACHE_MAXSIZE=1G +ENV PATH /usr/lib/ccache:/ardupilot/Tools:${PATH} diff --git a/Tools/scripts/install-prereqs-ubuntu.sh b/Tools/scripts/install-prereqs-ubuntu.sh index 6a4ca283a4..8cb5db0f58 100755 --- a/Tools/scripts/install-prereqs-ubuntu.sh +++ b/Tools/scripts/install-prereqs-ubuntu.sh @@ -76,7 +76,9 @@ fi sudo usermod -a -G dialout $USER -$APT_GET remove modemmanager +if dpkg-query -l "modemmanager"; then + $APT_GET remove modemmanager +fi $APT_GET update if apt-cache search python-wxgtk3.0 | grep wx; then