Configurable CC/CXX compiler toolchain in Dockerfiles. (#1402)
Allows to build Docker images with Clang.master
parent
01af348100
commit
aaa8a9a652
|
@ -22,14 +22,15 @@ cache:
|
||||||
- /home/travis/docker/
|
- /home/travis/docker/
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- LSB_RELEASE=trusty DOCKER_CACHE_FILE=/home/travis/docker/trusty-cache.tar.gz
|
- LSB_RELEASE=trusty DOCKER_CACHE_FILE=/home/travis/docker/trusty-cache.tar.gz CC=gcc CXX=g++
|
||||||
- LSB_RELEASE=xenial DOCKER_CACHE_FILE=/home/travis/docker/xenial-cache.tar.gz
|
- LSB_RELEASE=xenial DOCKER_CACHE_FILE=/home/travis/docker/xenial-cache.tar.gz CC=gcc CXX=g++
|
||||||
- LSB_RELEASE=jessie DOCKER_CACHE_FILE=/home/travis/docker/jessie-cache.tar.gz
|
- LSB_RELEASE=jessie DOCKER_CACHE_FILE=/home/travis/docker/jessie-cache.tar.gz CC=gcc CXX=g++
|
||||||
- LSB_RELEASE=stretch DOCKER_CACHE_FILE=/home/travis/docker/stretch-cache.tar.gz
|
- LSB_RELEASE=stretch DOCKER_CACHE_FILE=/home/travis/docker/stretch-cache.tar.gz CC=gcc CXX=g++
|
||||||
|
|
||||||
before_install: scripts/load_docker_cache.sh
|
before_install: scripts/load_docker_cache.sh
|
||||||
|
|
||||||
install: true
|
install: true
|
||||||
script:
|
script:
|
||||||
- docker build ${TRAVIS_BUILD_DIR} -t cartographer:${LSB_RELEASE} -f Dockerfile.${LSB_RELEASE}
|
- docker build ${TRAVIS_BUILD_DIR} -t cartographer:${LSB_RELEASE} -f Dockerfile.${LSB_RELEASE}
|
||||||
|
--build-arg cc=$CC --build-arg cxx=$CXX
|
||||||
- scripts/save_docker_cache.sh
|
- scripts/save_docker_cache.sh
|
||||||
|
|
|
@ -14,6 +14,13 @@
|
||||||
|
|
||||||
FROM debian:jessie
|
FROM debian:jessie
|
||||||
|
|
||||||
|
ARG cc
|
||||||
|
ARG cxx
|
||||||
|
|
||||||
|
# Set the preferred C/C++ compiler toolchain, if given (otherwise default).
|
||||||
|
ENV CC=$cc
|
||||||
|
ENV CXX=$cxx
|
||||||
|
|
||||||
# This base image doesn't ship with sudo.
|
# This base image doesn't ship with sudo.
|
||||||
RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,13 @@
|
||||||
|
|
||||||
FROM debian:stretch
|
FROM debian:stretch
|
||||||
|
|
||||||
|
ARG cc
|
||||||
|
ARG cxx
|
||||||
|
|
||||||
|
# Set the preferred C/C++ compiler toolchain, if given (otherwise default).
|
||||||
|
ENV CC=$cc
|
||||||
|
ENV CXX=$cxx
|
||||||
|
|
||||||
# This base image doesn't ship with sudo.
|
# This base image doesn't ship with sudo.
|
||||||
RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,14 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
FROM ubuntu:trusty
|
FROM ubuntu:trusty
|
||||||
|
|
||||||
|
ARG cc
|
||||||
|
ARG cxx
|
||||||
|
|
||||||
|
# Set the preferred C/C++ compiler toolchain, if given (otherwise default).
|
||||||
|
ENV CC=$cc
|
||||||
|
ENV CXX=$cxx
|
||||||
|
|
||||||
COPY scripts/install_debs_cmake.sh cartographer/scripts/
|
COPY scripts/install_debs_cmake.sh cartographer/scripts/
|
||||||
RUN cartographer/scripts/install_debs_cmake.sh && rm -rf /var/lib/apt/lists/*
|
RUN cartographer/scripts/install_debs_cmake.sh && rm -rf /var/lib/apt/lists/*
|
||||||
COPY scripts/install_ceres.sh cartographer/scripts/
|
COPY scripts/install_ceres.sh cartographer/scripts/
|
||||||
|
|
|
@ -13,6 +13,14 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
FROM ubuntu:trusty
|
FROM ubuntu:trusty
|
||||||
|
|
||||||
|
ARG cc
|
||||||
|
ARG cxx
|
||||||
|
|
||||||
|
# Set the preferred C/C++ compiler toolchain, if given (otherwise default).
|
||||||
|
ENV CC=$cc
|
||||||
|
ENV CXX=$cxx
|
||||||
|
|
||||||
COPY scripts/install_debs_bazel.sh cartographer/scripts/
|
COPY scripts/install_debs_bazel.sh cartographer/scripts/
|
||||||
RUN cartographer/scripts/install_debs_bazel.sh && rm -rf /var/lib/apt/lists/*
|
RUN cartographer/scripts/install_debs_bazel.sh && rm -rf /var/lib/apt/lists/*
|
||||||
COPY . cartographer
|
COPY . cartographer
|
||||||
|
|
|
@ -12,8 +12,16 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
FROM ubuntu:xenial
|
FROM ubuntu:xenial
|
||||||
|
|
||||||
|
ARG cc
|
||||||
|
ARG cxx
|
||||||
|
|
||||||
|
# Set the preferred C/C++ compiler toolchain, if given (otherwise default).
|
||||||
|
ENV CC=$cc
|
||||||
|
ENV CXX=$cxx
|
||||||
|
|
||||||
# This base image doesn't ship with sudo.
|
# This base image doesn't ship with sudo.
|
||||||
RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
|
clang \
|
||||||
g++ \
|
g++ \
|
||||||
git \
|
git \
|
||||||
google-mock \
|
google-mock \
|
||||||
|
|
Loading…
Reference in New Issue