I am running the drone pipeline with the below steps
- name: integration-tests
image: quay.io/testcontainers/dind-drone-plugin
settings:
build_image: openjdk:17-alpine
cmd:
- apk update
- apk add protobuf grpc curl file
- mkdir -p /root/.gradle/caches/modules-2/files-2.1/io.grpc/protoc-gen-grpc-java/1.56.1
- cd /root/.gradle/caches/modules-2/files-2.1/io.grpc/protoc-gen-grpc-java/1.56.1
- curl -LO https://repo.maven.apache.org/maven2/io/grpc/protoc-gen-grpc-java/1.56.1/protoc-gen-grpc-java-1.56.1-linux-x86_64.exe
- chmod 777 protoc-gen-grpc-java-1.56.1-linux-x86_64.exe
- export PATH=$PATH:/root/.gradle/caches/modules-2/files-2.1/io.grpc/protoc-gen-grpc-java/1.56.1
- cd /drone/src
- ls -l /root/.gradle/caches/modules-2/files-2.1/io.grpc/protoc-gen-grpc-java/1.56.1
- file /root/.gradle/caches/modules-2/files-2.1/io.grpc/protoc-gen-grpc-java/1.56.1/protoc-gen-grpc-java-1.56.1-linux-x86_64.exe
- ls -l /root/.gradle/caches/modules-2/files-2.1/io.grpc/protoc-gen-grpc-java/1.56.1
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib:/lib64:/usr/lib:/usr/local/lib
- /root/.gradle/caches/modules-2/files-2.1/io.grpc/protoc-gen-grpc-java/1.56.1/protoc-gen-grpc-java-1.56.1-linux-x86_64.exe
- ./gradlew clean cleanTest test --rerun-tasks -S
Eventhough the protoc-gen-grpc-java-1.56.1-linux-x86_64.exe is available the pipeline is available below error is thrown
sh: /root/.gradle/caches/modules-2/files-2.1/io.grpc/protoc-gen-grpc-java/1.56.1/protoc-gen-grpc-java-1.56.1-linux-x86_64.exe: not found
Any tips would be appreciated as I am new to drone CI
This is an issue in regards to using the alpine
container or alpine
as an os.
Alpine uses musl-libc
as its C standard library, whereas the protoc binary provided is compiled with glibc
.
The exception is misleading and unfortunately takes down the incorrect path, as the binary exists, it is just that Alpine does not recognise the binary as it is not compiled with musl-libc
.
You have 2 options:
Use a different os container like Ubuntu
Or install glibc as part of your docker build using the following: alpine-pkg-glibc
Alpine
Linux package to run binaries linked against glibc