-
Notifications
You must be signed in to change notification settings - Fork 127
allow wget in otel-dotnet-auto-install.sh #4076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or 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
Signed-off-by: Adrian Cole <[email protected]>
This was referenced Mar 6, 2025
pellared
reviewed
Mar 6, 2025
pellared
approved these changes
Mar 6, 2025
Co-authored-by: Robert Pająk <[email protected]>
RassK
approved these changes
Mar 6, 2025
nrcventura
approved these changes
Mar 6, 2025
Kielek
approved these changes
Mar 11, 2025
Member
Kielek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@codefromthecrypt, thanks! Looking for more contribution!
stevejgordon
pushed a commit
to elastic/elastic-otel-dotnet
that referenced
this pull request
Mar 11, 2025
This is the same fix as upstream here, which allows use of wget when curl isn't available, helpful on the runtime docker images. open-telemetry/opentelemetry-dotnet-instrumentation#4076 I tested it with a copy like below wget and not curl ```bash $ docker run --rm -it mcr.microsoft.com/dotnet/runtime:8.0-alpine / # sh -xc "$(wget -qO- https://gist.githubusercontent.com/codefromthecrypt/77865a27ad40dc4fa7ef35396a0ba4dc/raw/fa516690ee5afad5d53f1c4e7671a47a207b24d1/elastic-dotnet-auto- install.sh)" + set -e + '[' -z ] + uname -s + tr '[:upper:]' '[:lower:]' + ldd /bin/ls + grep -m1 musl + '[' ' /lib/ld-musl-aarch64.so.1 (0xfe39c41a3000)' ] + OS_TYPE=linux-musl + '[' -z ] + uname -m + ARCHITECTURE=arm64 + command -v curl + command -v wget + DOWNLOADER='wget -qO' + test -z + OTEL_DOTNET_AUTO_HOME=/root/.otel-dotnet-auto + test -z + VERSION=1.0.0-alpha.6 + mktemp -d + DOWNLOAD_DIR=/tmp/tmp.EPCdHh + RELEASES_URL=https://github.com/elastic/elastic-otel-dotnet/releases + ARCHIVE=elastic-dotnet-instrumentation-linux-musl.zip + echo linux-musl + grep -q linux + ARCHIVE=elastic-dotnet-instrumentation-linux-musl-arm64.zip + LOCAL_PATH=/tmp/tmp.EPCdHh/elastic-dotnet-instrumentation-linux-musl-arm64.zip + '[' '!' -f /tmp/tmp.EPCdHh/elastic-dotnet-instrumentation-linux-musl-arm64.zip ] + cd /tmp/tmp.EPCdHh + echo 'Downloading 1.0.0-alpha.6 for linux-musl (/tmp/tmp.EPCdHh/elastic-dotnet-instrumentation-linux-musl-arm64.zip)...' Downloading 1.0.0-alpha.6 for linux-musl (/tmp/tmp.EPCdHh/elastic-dotnet-instrumentation-linux-musl-arm64.zip)... + wget -qO /tmp/tmp.EPCdHh/elastic-dotnet-instrumentation-linux-musl-arm64.zip https://github.com/elastic/elastic-otel-dotnet/releases/download/1.0.0-alpha.6/elastic-dotnet-instrumentation-linux-musl-arm64.zip + rm -rf /root/.otel-dotnet-auto + unzip -q /tmp/tmp.EPCdHh/elastic-dotnet-instrumentation-linux-musl-arm64.zip -d /root/.otel-dotnet-auto ``` Curl still works ``` ± |main {2} U:1 ✗| → docker run --rm -it mcr.microsoft.com/dotnet/sdk:8.0-alpine Unable to find image 'mcr.microsoft.com/dotnet/sdk:8.0-alpine' locally 8.0-alpine: Pulling from dotnet/sdk 6e771e15690e: Already exists 22672aa052ce: Already exists f933357a8a45: Already exists 0cf14cd91458: Already exists f48aab829812: Already exists 9a429f248167: Already exists 7af66d400433: Already exists Digest: sha256:1659a7a350b7847f6afc84df1409c6b80fd08e7decf51f5c365303b0d625f13b Status: Downloaded newer image for mcr.microsoft.com/dotnet/sdk:8.0-alpine / # sh -xc "$(curl -fsSL https://gist.githubusercontent.com/codefromthecrypt/77865a27ad40dc4fa7ef35396a0ba4dc/raw/fa516690ee5afad5d53f1c4e7671a47a207b24d1/elastic-dotnet-auto -install.sh)" + set -e + '[' -z ] + uname -s + tr '[:upper:]' '[:lower:]' + ldd /bin/ls + grep -m1 musl + '[' ' /lib/ld-musl-aarch64.so.1 (0xe9a87ee35000)' ] + OS_TYPE=linux-musl + '[' -z ] + uname -m + ARCHITECTURE=arm64 + command -v curl + DOWNLOADER='curl -sSfLo' + test -z + OTEL_DOTNET_AUTO_HOME=/root/.otel-dotnet-auto + test -z + VERSION=1.0.0-alpha.6 + mktemp -d + DOWNLOAD_DIR=/tmp/tmp.mECpGE + RELEASES_URL=https://github.com/elastic/elastic-otel-dotnet/releases + ARCHIVE=elastic-dotnet-instrumentation-linux-musl.zip + echo linux-musl + grep -q linux + ARCHIVE=elastic-dotnet-instrumentation-linux-musl-arm64.zip + LOCAL_PATH=/tmp/tmp.mECpGE/elastic-dotnet-instrumentation-linux-musl-arm64.zip + '[' '!' -f /tmp/tmp.mECpGE/elastic-dotnet-instrumentation-linux-musl-arm64.zip ] + cd /tmp/tmp.mECpGE + echo 'Downloading 1.0.0-alpha.6 for linux-musl (/tmp/tmp.mECpGE/elastic-dotnet-instrumentation-linux-musl-arm64.zip)...' Downloading 1.0.0-alpha.6 for linux-musl (/tmp/tmp.mECpGE/elastic-dotnet-instrumentation-linux-musl-arm64.zip)... + curl -sSfLo /tmp/tmp.mECpGE/elastic-dotnet-instrumentation-linux-musl-arm64.zip https://github.com/elastic/elastic-otel-dotnet/releases/download/1.0.0-alpha.6/elastic-dotnet-instrumentation-linux-musl-arm64.zip + rm -rf /root/.otel-dotnet-auto + unzip -q /tmp/tmp.mECpGE/elastic-dotnet-instrumentation-linux-musl-arm64.zip -d /root/.otel-dotnet-auto ``` Signed-off-by: Adrian Cole <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
I want to be able to use otel-dotnet-auto-install.sh on mcr.microsoft.com/dotnet/runtime:8.0-alpine which doesn't have curl, and without adding a package for it.
Fixes #4072
What
This conditionally uses curl or wget in that order.
Tests
I tested this by running the relevant shell script on mcr.microsoft.com/dotnet/runtime:8.0-alpine, which only has wget, and mcr.microsoft.com/dotnet/sdk:8.0-alpine which also has curl. Both worked and the latter used curl.
Checklist
CHANGELOG.mdis updated.- [ ] Documentation is updated.- [ ] New features are covered by tests.