Skip to content
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

Unexpected otel environment variables inside docker buildx build after this action #356

Open
3 tasks done
MidasLamb opened this issue Sep 25, 2024 · 0 comments
Open
3 tasks done

Comments

@MidasLamb
Copy link

Contributing guidelines

I've found a bug, and:

  • The documentation does not mention anything about my problem
  • There are no open or closed issues that are related to my problem

Description

When using this action, when building an image with buildx, it introduces unexpected environment variables related with telemetry.

Expected behaviour

When building busybox image with RUN env, I expect the following during build:
(These are the environment variables I get locally and in github actions if I don't use this action and use the provided version on the runner)

#5 [2/2] RUN env
#5 0.126 SHLVL=1
#5 0.126 HOME=/root
#5 0.126 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Actual behaviour

When running busybox image with RUN env, I get a lot more environment variables than expected

#5 [2/2] RUN env
#5 0.043 OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc
#5 0.043 SHLVL=1
#5 0.043 HOME=/root
#5 0.043 OTEL_TRACE_PARENT=00-c721631977cd93d91b16d2c2b54718b2-5684774e47a1b670-01
#5 0.043 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
#5 0.043 OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=unix:///dev/otel-grpc.sock
#5 0.043 TRACEPARENT=00-c721631977cd93d91b16d2c2b54718b2-5684774e47a1b670-01
#5 0.043 ***
#5 0.043 OTEL_TRACES_EXPORTER=otlp

Repository URL

No response

Workflow run URL

No response

YAML workflow

name: CI

on:
  pull_request:
    branches:
      - master
      - release/*
jobs:
  midas-test:
    name: Midas Test
    runs-on: ubuntu-22.04

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Build docker
        run: |-
          env
          docker build --progress=plain -f - . <<EOF
          FROM busybox:latest
          RUN env
          EOF

      - name: Build docker bake
        if: always()
        run: |-
          env
          docker buildx bake --file docker-compose.yml --progress=plain --no-cache --load midas

      - name: Build docker build
        if: always()
        run: |-
          env
          docker buildx build --file midas.Dockerfile --progress=plain --no-cache .

      - name: Docker bake
        uses: docker/bake-action@v5
        if: always()
        with:
          files: docker-compose.yml
          push: false
          load: true # Make sure it's in the docker registry, so the next step can get it.
          targets: midas

Workflow logs

No response

BuildKit logs

No response

Additional info

When referring to an image file (midas.Dockerfile), the contents are just:

FROM busybox:latest
RUN env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant