mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
docker: new build interface script
The new build script can pass arguments directly to ubuntu.sh when building, this is good for when you want a special build for example when you don't need RTPS or Simulation ``` ./Tools/docker_build.sh --no-sim-tools ``` In the future it can be extended if needed to generate multiple docker images based on the same Dockerfile, if for example we only want to build arm targets
This commit is contained in:
parent
38fc86cf3b
commit
ba9b23c2d1
20
Tools/docker_build.sh
Executable file
20
Tools/docker_build.sh
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ -z "${DOCKER_TAG}" ]]; then
|
||||
TAG_NAME="latest"
|
||||
else
|
||||
TAG_NAME="${DOCKER_TAG}"
|
||||
fi
|
||||
|
||||
PX4_DOCKER_REPO="px4io/px4-dev:$TAG_NAME"
|
||||
BUILD_ARGS="${@}"
|
||||
PWD=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
SRC_DIR=$PWD/../
|
||||
|
||||
echo "[docker_build.sh]: Building [$PX4_DOCKER_REPO]"
|
||||
echo "[docker_build.sh]: - with args: [$BUILD_ARGS]"
|
||||
|
||||
docker build \
|
||||
-t ${PX4_DOCKER_REPO} \
|
||||
-f Tools/setup/Dockerfile "${SRC_DIR}" \
|
||||
--build-arg INSTALL_ARGS="${BUILD_ARGS}"
|
||||
@ -27,13 +27,17 @@ COPY Tools/setup/ubuntu.sh /tmp/ubuntu.sh
|
||||
# We support pre-downloading the gcc arm none eabi compiler
|
||||
# to speed up build times, if the file is not present when
|
||||
# building, the ubuntu.sh script will download it from source
|
||||
COPY *gcc-arm-none-eabi-9-2020-q2-update-linux.tar.bz2 /tmp/gcc-arm-none-eabi-9-2020-q2-update-linux.tar.bz2
|
||||
COPY gcc-arm-none-eabi-9-2020-q2-update-linux.tar.* /tmp/
|
||||
# The PATH env is set within ubuntu.sh, but given how we
|
||||
# are running the image using `gosu` to avoid read-only problems
|
||||
# with the filesystem the env variable does not persist
|
||||
ENV PATH="/opt/gcc-arm-none-eabi-9-2020-q2-update/bin:$PATH"
|
||||
ENV PATH="/opt/jdk-14.0.2+12/bin:$PATH"
|
||||
RUN bash /tmp/ubuntu.sh --from-docker --with-java --with-rtps --no-sim-tools
|
||||
|
||||
# For a complete list of INSTALL_ARGS options run:
|
||||
# ./Tools/setup/ubuntu.sh --help
|
||||
ARG INSTALL_ARGS
|
||||
RUN bash /tmp/ubuntu.sh --from-docker $INSTALL_ARGS
|
||||
|
||||
ENV DISPLAY :99
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user