File tree 4 files changed +110
-4
lines changed
4 files changed +110
-4
lines changed Original file line number Diff line number Diff line change
1
+ name : ' OpenTelemetry-cpp dependencies image'
2
+ on :
3
+ schedule :
4
+ - cron : " 0 3 * * 6"
5
+
6
+ jobs :
7
+ docker_image :
8
+ name : Docker Image
9
+ runs-on : ubuntu-latest
10
+ timeout-minutes : 300
11
+ steps :
12
+ -
13
+ name : checkout
14
+ uses : actions/checkout@v2
15
+ -
16
+ name : Set up QEMU
17
+ uses : docker/setup-qemu-action@v1
18
+ -
19
+ name : Set up Docker Buildx
20
+ id : buildx
21
+ uses : docker/setup-buildx-action@v1
22
+ -
23
+ name : Build Image
24
+ uses : docker/build-push-action@v2
25
+ with :
26
+ builder : ${{ steps.buildx.outputs.name }}
27
+ context : ci/
28
+ file : ./docker/Dockerfile
29
+ build-args : BASE_IMAGE=ubuntu:latest
30
+ platforms : linux/amd64
31
+ # platforms: linux/amd64,linux/arm64
32
+ push : false
33
+ tags : otel-cpp-deps
34
+ load : true
35
+ -
36
+ name : Save Image
37
+ run : |
38
+ docker images
39
+ docker save -o /opt/otel-cpp-deps-debian.tar otel-cpp-deps
40
+ -
41
+ name : Upload Image
42
+ uses : actions/upload-artifact@v3
43
+ with :
44
+ name : otel-cpp-deps
45
+ path : /opt/otel-cpp-deps-debian.tar
46
+ retention-days : 14
Original file line number Diff line number Diff line change @@ -10,13 +10,17 @@ new_grpc_version='v1.43.2'
10
10
gcc_version_for_new_grpc=' 5.1'
11
11
install_grpc_version=${new_grpc_version}
12
12
grpc_version=' v1.39.0'
13
- usage () { echo " Usage: $0 -v <gcc-version>" 1>&2 ; exit 1; }
13
+ install_dir=' /usr/local/'
14
+ usage () { echo " Usage: $0 [-v <gcc-version>] [-i <install_dir>" ] 1>&2 ; exit 1; }
14
15
15
- while getopts " :v:" o; do
16
+ while getopts " :v:i: " o; do
16
17
case " ${o} " in
17
18
v)
18
19
gcc_version=${OPTARG}
19
20
;;
21
+ i)
22
+ install_dir=${OPTARG}
23
+ ;;
20
24
* )
21
25
usage
22
26
;;
@@ -34,7 +38,7 @@ if ! type cmake > /dev/null; then
34
38
exit 1
35
39
fi
36
40
export BUILD_DIR=/tmp/
37
- export INSTALL_DIR=/usr/local/
41
+ export INSTALL_DIR=${install_dir}
38
42
pushd $BUILD_DIR
39
43
echo " installing grpc version: ${install_grpc_version} "
40
44
git clone --depth=1 -b ${install_grpc_version} https://github.com/grpc/grpc
Original file line number Diff line number Diff line change 4
4
export DEBIAN_FRONTEND=noninteractive
5
5
export THRIFT_VERSION=0.14.1
6
6
7
+ install_dir=' /usr/local/'
8
+ while getopts " :i:" o; do
9
+ case " ${o} " in
10
+ i)
11
+ install_dir=${OPTARG}
12
+ ;;
13
+ * )
14
+ ;;
15
+ esac
16
+ done
17
+
7
18
apt update
8
19
9
20
if ! type cmake > /dev/null; then
10
21
# cmake not installed, exiting
11
22
exit 1
12
23
fi
13
24
export BUILD_DIR=/tmp/
14
- export INSTALL_DIR=/usr/local/
25
+ export INSTALL_DIR=${install_dir}
15
26
16
27
apt install -y --no-install-recommends \
17
28
libboost-locale-dev \
@@ -44,6 +55,8 @@ cmake -G Ninja .. \
44
55
-DWITH_BOOSTTHREADS=OFF \
45
56
-DWITH_BOOST_FUNCTIONAL=OFF \
46
57
-DWITH_BOOST_SMART_PTR=OFF \
58
+ -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \
59
+ -DCMAKE_PREFIX_PATH=$INSTALL_DIR \
47
60
..
48
61
49
62
ninja -j $( nproc)
Original file line number Diff line number Diff line change
1
+ ARG BASE_IMAGE=ubuntu:latest
2
+ ARG CORES=${nproc}
3
+
4
+ FROM ${BASE_IMAGE} as base
5
+
6
+ ENV DEBIAN_FRONTEND=noninteractive
7
+
8
+ RUN apt-get update && apt-get install -y build-essential autoconf \
9
+ libtool pkg-config cmake git libssl-dev curl \
10
+ libcurl4-openssl-dev libgtest-dev libgmock-dev libbenchmark-dev
11
+
12
+ WORKDIR /work
13
+ RUN mkdir -p /opt/otel-cpp
14
+
15
+ FROM base as grpc
16
+ # install grpc, protobuf and abseil
17
+ ARG GRPC_VERSION=1.43.2
18
+
19
+ ADD setup_grpc.sh .
20
+ RUN ./setup_grpc.sh -i "/opt/otel-cpp" -v ${GRPC_VERSION}
21
+
22
+ FROM base as thrift
23
+ RUN apt-get install -y --no-install-recommends wget
24
+
25
+ # install thrift
26
+ ARG THRIFT_VERSION=0.14.1
27
+ ADD setup_thrift.sh .
28
+ RUN ./setup_thrift.sh -i "/opt/otel-cpp"
29
+
30
+ FROM scratch as final
31
+
32
+ COPY --from=grpc /opt/otel-cpp /
33
+ COPY --from=thrift /opt/otel-cpp /
34
+
35
+ # how to use:
36
+ #
37
+ # docker create -ti --name deps otel-cpp-deps bash
38
+ # docker cp deps:/ ./
39
+ # docker rm -f deps
40
+ #
41
+ # or:
42
+ #
43
+ # COPY --from=otel-cpp-deps /usr
You can’t perform that action at this time.
0 commit comments