Introduce bazel docker file (#838)

master
Christoph Schütte 2018-01-23 10:50:51 +01:00 committed by Wally B. Feed
parent 43008d391d
commit f1616e16ec
11 changed files with 89 additions and 14 deletions

View File

@ -17,11 +17,11 @@ FROM debian:jessie
# 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/*
COPY scripts/install_debs.sh cartographer/scripts/ COPY scripts/install_debs_cmake.sh cartographer/scripts/
RUN cartographer/scripts/install_debs.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/
RUN cartographer/scripts/install_ceres.sh && rm -rf ceres-solver RUN cartographer/scripts/install_ceres.sh && rm -rf ceres-solver
COPY scripts/install_proto3.sh cartographer/scripts/ COPY scripts/install_proto3.sh cartographer/scripts/
RUN cartographer/scripts/install_proto3.sh && rm -rf protobuf RUN cartographer/scripts/install_proto3.sh && rm -rf protobuf
COPY . cartographer COPY . cartographer
RUN cartographer/scripts/install_cartographer.sh && rm -rf cartographer RUN cartographer/scripts/install_cartographer_cmake.sh && rm -rf cartographer

View File

@ -17,11 +17,11 @@ FROM debian:stretch
# 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/*
COPY scripts/install_debs.sh cartographer/scripts/ COPY scripts/install_debs_cmake.sh cartographer/scripts/
RUN cartographer/scripts/install_debs.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/
RUN cartographer/scripts/install_ceres.sh && rm -rf ceres-solver RUN cartographer/scripts/install_ceres.sh && rm -rf ceres-solver
COPY scripts/install_proto3.sh cartographer/scripts/ COPY scripts/install_proto3.sh cartographer/scripts/
RUN cartographer/scripts/install_proto3.sh && rm -rf protobuf RUN cartographer/scripts/install_proto3.sh && rm -rf protobuf
COPY . cartographer COPY . cartographer
RUN cartographer/scripts/install_cartographer.sh && rm -rf cartographer RUN cartographer/scripts/install_cartographer_cmake.sh && rm -rf cartographer

View File

@ -13,8 +13,8 @@
# limitations under the License. # limitations under the License.
FROM ubuntu:trusty FROM ubuntu:trusty
COPY scripts/install_debs.sh cartographer/scripts/ COPY scripts/install_debs_cmake.sh cartographer/scripts/
RUN cartographer/scripts/install_debs.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/
RUN cartographer/scripts/install_ceres.sh && rm -rf ceres-solver RUN cartographer/scripts/install_ceres.sh && rm -rf ceres-solver
COPY scripts/install_proto3.sh cartographer/scripts/ COPY scripts/install_proto3.sh cartographer/scripts/
@ -22,4 +22,4 @@ RUN cartographer/scripts/install_proto3.sh && rm -rf protobuf
COPY scripts/install_grpc.sh cartographer/scripts/ COPY scripts/install_grpc.sh cartographer/scripts/
RUN cartographer/scripts/install_grpc.sh && rm -rf grpc RUN cartographer/scripts/install_grpc.sh && rm -rf grpc
COPY . cartographer COPY . cartographer
RUN cartographer/scripts/install_cartographer_with_grpc.sh && rm -rf cartographer RUN cartographer/scripts/install_cartographer_cmake_with_grpc.sh && rm -rf cartographer

19
Dockerfile.trusty.bazel Normal file
View File

@ -0,0 +1,19 @@
# Copyright 2016 The Cartographer Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM ubuntu:trusty
COPY scripts/install_debs_bazel.sh cartographer/scripts/
RUN cartographer/scripts/install_debs_bazel.sh && rm -rf /var/lib/apt/lists/*
COPY . cartographer
RUN cartographer/scripts/install_cartographer_bazel.sh && rm -rf cartographer

View File

@ -17,11 +17,11 @@ FROM ubuntu:xenial
# 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/*
COPY scripts/install_debs.sh cartographer/scripts/ COPY scripts/install_debs_cmake.sh cartographer/scripts/
RUN cartographer/scripts/install_debs.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/
RUN cartographer/scripts/install_ceres.sh && rm -rf ceres-solver RUN cartographer/scripts/install_ceres.sh && rm -rf ceres-solver
COPY scripts/install_proto3.sh cartographer/scripts/ COPY scripts/install_proto3.sh cartographer/scripts/
RUN cartographer/scripts/install_proto3.sh && rm -rf protobuf RUN cartographer/scripts/install_proto3.sh && rm -rf protobuf
COPY . cartographer COPY . cartographer
RUN cartographer/scripts/install_cartographer.sh && rm -rf cartographer RUN cartographer/scripts/install_cartographer_cmake.sh && rm -rf cartographer

View File

@ -64,7 +64,7 @@ with the standalone library. Currently, it is the best available reference.
On Ubuntu 14.04 (Trusty): On Ubuntu 14.04 (Trusty):
.. literalinclude:: ../../scripts/install_debs.sh .. literalinclude:: ../../scripts/install_debs_cmake.sh
:language: bash :language: bash
:lines: 20- :lines: 20-
@ -76,7 +76,7 @@ On Ubuntu 14.04 (Trusty):
:language: bash :language: bash
:lines: 20- :lines: 20-
.. literalinclude:: ../../scripts/install_cartographer.sh .. literalinclude:: ../../scripts/install_cartographer_cmake.sh
:language: bash :language: bash
:lines: 20- :lines: 20-

View File

@ -0,0 +1,23 @@
#!/bin/sh
# Copyright 2016 The Cartographer Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -o errexit
set -o verbose
# Build and install Cartographer.
cd cartographer
bazel build //...
bazel test //...

33
scripts/install_debs_bazel.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/sh
# Copyright 2016 The Cartographer Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -o errexit
set -o verbose
# Install the required libraries that are available as debs.
sudo apt-get update
sudo apt-get install -y \
wget \
pkg-config \
zip \
g++ \
zlib1g-dev \
unzip \
python
wget https://github.com/bazelbuild/bazel/releases/download/0.9.0/bazel-0.9.0-installer-linux-x86_64.sh
chmod +x bazel-0.9.0-installer-linux-x86_64.sh
./bazel-0.9.0-installer-linux-x86_64.sh
export PATH="$PATH:$HOME/bin"