-
Notifications
You must be signed in to change notification settings - Fork 31
/
Dockerfile
50 lines (38 loc) · 1.47 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM ubuntu:18.04
ARG COPTER_TAG=Copter-4.0.3
# install git
RUN apt-get update && apt-get install -y git; git config --global url."https://github.com/".insteadOf git://github.com/
# Now grab ArduPilot from GitHub
RUN git clone https://github.com/ArduPilot/ardupilot.git ardupilot
WORKDIR ardupilot
# Checkout the latest Copter...
RUN git checkout ${COPTER_TAG}
# Now start build instructions from http://ardupilot.org/dev/docs/setting-up-sitl-on-linux.html
RUN git submodule update --init --recursive
# Trick to get apt-get to not prompt for timezone in tzdata
ENV DEBIAN_FRONTEND=noninteractive
# Need sudo and lsb-release for the installation prerequisites
RUN apt-get install -y sudo lsb-release tzdata
# Need USER set so usermod does not fail...
# Install all prerequisites now
RUN USER=nobody Tools/environment_install/install-prereqs-ubuntu.sh -y
# Continue build instructions from https://github.com/ArduPilot/ardupilot/blob/master/BUILD.md
RUN ./waf distclean
RUN ./waf configure --board sitl
RUN ./waf copter
RUN ./waf rover
RUN ./waf plane
RUN ./waf sub
# TCP 5760 is what the sim exposes by default
EXPOSE 5760/tcp
# Variables for simulator
ENV INSTANCE 0
ENV LAT 42.3898
ENV LON -71.1476
ENV ALT 14
ENV DIR 270
ENV MODEL +
ENV SPEEDUP 1
ENV VEHICLE ArduCopter
# Finally the command
ENTRYPOINT /ardupilot/Tools/autotest/sim_vehicle.py --vehicle ${VEHICLE} -I${INSTANCE} --custom-location=${LAT},${LON},${ALT},${DIR} -w --frame ${MODEL} --no-rebuild --no-mavproxy --speedup ${SPEEDUP}