Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Commit d6e90be

Browse files
author
Takashi Matsuo
authored
Refactor Dockerfiles (#6)
1 parent aefb8c9 commit d6e90be

File tree

6 files changed

+109
-85
lines changed

6 files changed

+109
-85
lines changed
File renamed without changes.

ci/kokoro/Dockerfile.ubuntu

Lines changed: 0 additions & 81 deletions
This file was deleted.

ci/kokoro/Dockerfile.ubuntu-16.04

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
FROM ubuntu:16.04
16+
17+
RUN apt update && \
18+
apt install -y \
19+
automake \
20+
build-essential \
21+
clang \
22+
cmake \
23+
curl \
24+
doxygen \
25+
gawk \
26+
git \
27+
gcc \
28+
golang \
29+
g++ \
30+
libssl-dev \
31+
libtool \
32+
make \
33+
ninja-build \
34+
pkg-config \
35+
python-pip \
36+
shellcheck \
37+
tar \
38+
unzip \
39+
wget \
40+
zlib1g-dev
41+
42+
WORKDIR /var/tmp/Downloads
43+
RUN wget -q https://github.com/c-ares/c-ares/archive/cares-1_15_0.tar.gz && \
44+
tar -xf cares-1_15_0.tar.gz && \
45+
cd /var/tmp/Downloads/c-ares-cares-1_15_0 && \
46+
./buildconf && ./configure && make -j $(nproc) && \
47+
make install && \
48+
ldconfig
49+
50+
# Install grpc from source
51+
WORKDIR /var/tmp/ci
52+
COPY install-grpc.sh /var/tmp/ci
53+
RUN /var/tmp/ci/install-grpc.sh

ci/kokoro/Dockerfile.ubuntu-18.04

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
FROM ubuntu:18.04
16+
17+
RUN apt update && \
18+
apt install -y \
19+
build-essential \
20+
clang \
21+
cmake \
22+
curl \
23+
doxygen \
24+
gawk \
25+
git \
26+
gcc \
27+
golang \
28+
g++ \
29+
libc-ares-dev \
30+
libc-ares2 \
31+
libssl-dev \
32+
make \
33+
ninja-build \
34+
pkg-config \
35+
python-pip \
36+
shellcheck \
37+
tar \
38+
unzip \
39+
wget \
40+
zlib1g-dev
41+
42+
# Install grpc from source
43+
WORKDIR /var/tmp/ci
44+
COPY install-grpc.sh /var/tmp/ci
45+
RUN /var/tmp/ci/install-grpc.sh

ci/kokoro/create-docker-image.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ fi
2323
source "${PROJECT_ROOT}/ci/kokoro/define-docker-variables.sh"
2424

2525
cd "${PROJECT_ROOT}"
26-
sudo docker build -t "${IMAGE}:tip" \
27-
--build-arg DISTRO_VERSION="${DISTRO_VERSION}" \
28-
-f "ci/kokoro/Dockerfile.${DISTRO}" ci
26+
27+
# If there's a version specific Dockerfile, we use it.
28+
if [[ -f "ci/kokoro/Dockerfile.${DISTRO}-${DISTRO_VERSION}" ]]; then
29+
sudo docker build -t "${IMAGE}:tip" \
30+
-f "ci/kokoro/Dockerfile.${DISTRO}-${DISTRO_VERSION}" ci
31+
else
32+
sudo docker build -t "${IMAGE}:tip" \
33+
--build-arg DISTRO_VERSION="${DISTRO_VERSION}" \
34+
-f "ci/kokoro/Dockerfile.${DISTRO}" ci
35+
fi

ci/kokoro/docker/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fi
4747
if [[ "${BUILD_NAME}" = "clang-tidy" ]]; then
4848
# Compile with clang-tidy(1) turned on. The build treats clang-tidy warnings
4949
# as errors.
50-
export DISTRO=fedora-install
50+
export DISTRO=fedora
5151
export DISTRO_VERSION=30
5252
export CC=clang
5353
export CXX=clang++

0 commit comments

Comments
 (0)