-
Notifications
You must be signed in to change notification settings - Fork 417
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dependencies image as artifact (#1333)
Co-authored-by: Lalit Kumar Bhasin <lalit_fin@yahoo.com>
- Loading branch information
Showing
4 changed files
with
110 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: 'OpenTelemetry-cpp dependencies image' | ||
on: | ||
schedule: | ||
- cron: "0 3 * * 6" | ||
|
||
jobs: | ||
docker_image: | ||
name: Docker Image | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 300 | ||
steps: | ||
- | ||
name: checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- | ||
name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
name: Build Image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: ci/ | ||
file: ./docker/Dockerfile | ||
build-args: BASE_IMAGE=ubuntu:latest | ||
platforms: linux/amd64 | ||
# platforms: linux/amd64,linux/arm64 | ||
push: false | ||
tags: otel-cpp-deps | ||
load: true | ||
- | ||
name: Save Image | ||
run: | | ||
docker images | ||
docker save -o /opt/otel-cpp-deps-debian.tar otel-cpp-deps | ||
- | ||
name: Upload Image | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: otel-cpp-deps | ||
path: /opt/otel-cpp-deps-debian.tar | ||
retention-days: 14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
ARG BASE_IMAGE=ubuntu:latest | ||
ARG CORES=${nproc} | ||
|
||
FROM ${BASE_IMAGE} as base | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && apt-get install -y build-essential autoconf \ | ||
libtool pkg-config cmake git libssl-dev curl \ | ||
libcurl4-openssl-dev libgtest-dev libgmock-dev libbenchmark-dev | ||
|
||
WORKDIR /work | ||
RUN mkdir -p /opt/otel-cpp | ||
|
||
FROM base as grpc | ||
# install grpc, protobuf and abseil | ||
ARG GRPC_VERSION=1.43.2 | ||
|
||
ADD setup_grpc.sh . | ||
RUN ./setup_grpc.sh -i "/opt/otel-cpp" -v ${GRPC_VERSION} | ||
|
||
FROM base as thrift | ||
RUN apt-get install -y --no-install-recommends wget | ||
|
||
# install thrift | ||
ARG THRIFT_VERSION=0.14.1 | ||
ADD setup_thrift.sh . | ||
RUN ./setup_thrift.sh -i "/opt/otel-cpp" | ||
|
||
FROM scratch as final | ||
|
||
COPY --from=grpc /opt/otel-cpp / | ||
COPY --from=thrift /opt/otel-cpp / | ||
|
||
# how to use: | ||
# | ||
# docker create -ti --name deps otel-cpp-deps bash | ||
# docker cp deps:/ ./ | ||
# docker rm -f deps | ||
# | ||
# or: | ||
# | ||
# COPY --from=otel-cpp-deps /usr |