diff --git a/.github/jsonnetfile.json b/.github/jsonnetfile.json index 58c6d34c67c48..731d3c3c82974 100644 --- a/.github/jsonnetfile.json +++ b/.github/jsonnetfile.json @@ -8,7 +8,7 @@ "subdir": "workflows" } }, - "version": "20aac53fcb06d378b1c1101c7e4dc989466eb4ff" + "version": "21f1189544e3976070cbdb6463f64c7a32dcc176" } ], "legacyImports": true diff --git a/.github/jsonnetfile.lock.json b/.github/jsonnetfile.lock.json index 5d356b0b4fb0b..d11f133725822 100644 --- a/.github/jsonnetfile.lock.json +++ b/.github/jsonnetfile.lock.json @@ -8,8 +8,8 @@ "subdir": "workflows" } }, - "version": "20aac53fcb06d378b1c1101c7e4dc989466eb4ff", - "sum": "bo355Fm9Gm1TU13MjlXGXgrCXo4CPr7aEeTvgNFYAl8=" + "version": "21f1189544e3976070cbdb6463f64c7a32dcc176", + "sum": "IPS1oGR8k7jk6J2snciTycWFgtISCwXSPhJ3A+nEGvY=" } ], "legacyImports": false diff --git a/.github/release-workflows.jsonnet b/.github/release-workflows.jsonnet index 6c16af50ad74c..bc00da6e2ad40 100644 --- a/.github/release-workflows.jsonnet +++ b/.github/release-workflows.jsonnet @@ -15,6 +15,7 @@ local imageJobs = { 'loki-canary-boringcrypto': build.image('loki-canary-boringcrypto', 'cmd/loki-canary-boringcrypto'), promtail: build.image('promtail', 'clients/cmd/promtail'), querytee: build.image('loki-query-tee', 'cmd/querytee', platform=['linux/amd64']), + 'loki-docker-driver': build.dockerPlugin('grafana/loki-docker-driver', 'clients/cmd/docker-driver', platform=['linux/amd64', 'linux/arm64']), }; local weeklyImageJobs = { @@ -27,6 +28,7 @@ local weeklyImageJobs = { 'loki-canary-boringcrypto': build.weeklyImage('loki-canary-boringcrypto', 'cmd/loki-canary-boringcrypto'), promtail: build.weeklyImage('promtail', 'clients/cmd/promtail'), querytee: build.weeklyImage('loki-query-tee', 'cmd/querytee', platform=['linux/amd64']), + 'loki-docker-driver': build.weeklyDockerPlugin('grafana/loki-docker-driver', 'clients/cmd/docker-driver', platform=['linux/amd64', 'linux/arm64']), }; local buildImageVersion = std.extVar('BUILD_IMAGE_VERSION'); diff --git a/.github/vendor/github.com/grafana/loki-release/workflows/build.libsonnet b/.github/vendor/github.com/grafana/loki-release/workflows/build.libsonnet index 7343c7d72963d..72a47e901e890 100644 --- a/.github/vendor/github.com/grafana/loki-release/workflows/build.libsonnet +++ b/.github/vendor/github.com/grafana/loki-release/workflows/build.libsonnet @@ -105,6 +105,152 @@ local releaseLibStep = common.releaseLibStep; }), ]), + dockerPlugin: function( + name, + path, + dockerfile='Dockerfile', + context='release', + platform=[ + 'linux/amd64', + 'linux/arm64', + 'linux/arm', + ] + ) + job.new() + + job.withStrategy({ + 'fail-fast': true, + matrix: { + platform: platform, + }, + }) + + job.withSteps([ + common.fetchReleaseLib, + common.fetchReleaseRepo, + common.setupNode, + common.googleAuth, + + step.new('Set up QEMU', 'docker/setup-qemu-action@v3'), + step.new('set up docker buildx', 'docker/setup-buildx-action@v3'), + + releaseStep('parse image platform') + + step.withId('platform') + + step.withRun(||| + mkdir -p images + + platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")" + echo "platform=${platform}" >> $GITHUB_OUTPUT + echo "platform_short=$(echo ${{ matrix.platform }} | cut -d / -f 2)" >> $GITHUB_OUTPUT + if [[ "${platform}" == "linux/arm64" ]]; then + echo "plugin_arch=-arm64" >> $GITHUB_OUTPUT + else + echo "plugin_arch=" >> $GITHUB_OUTPUT + fi + |||), + + step.new('Build and export', 'docker/build-push-action@v6') + + step.withTimeoutMinutes('${{ fromJSON(env.BUILD_TIMEOUT) }}') + + step.withIf('${{ fromJSON(needs.version.outputs.pr_created) }}') + + step.withEnv({ + IMAGE_TAG: '${{ needs.version.outputs.version }}', + }) + + step.with({ + context: context, + file: 'release/%s/%s' % [path, dockerfile], + platforms: '${{ matrix.platform }}', + push: false, + tags: '${{ env.IMAGE_PREFIX }}/%s:${{ needs.version.outputs.version }}-${{ steps.platform.outputs.platform_short }}' % [name], + outputs: 'type=docker,dest=release/images/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar' % name, + 'build-args': 'IMAGE_TAG=${{ needs.version.outputs.version }},GOARCH=${{ steps.platform.outputs.platform_short }}', + }), + + releaseStep('Package as Docker plugin') + + step.withIf('${{ fromJSON(needs.version.outputs.pr_created) }}') + + step.withEnv({ + IMAGE_TAG: '${{ needs.version.outputs.version }}', + BUILD_DIR: 'release/%s' % [path], + }) + + step.withRun(||| + rm -rf "${{ env.BUILD_DIR }}/rootfs" || true + mkdir "${{ env.BUILD_DIR }}/rootfs" + tar -x -C "${{ env.BUILD_DIR }}/rootfs" -f "release/images/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar" + docker plugin create "${{ env.IMAGE_TAG }}${{ steps.platform.outputs.plugin_arch }}" "${{ env.BUILD_DIR }}" + |||), + + step.new('upload artifacts', 'google-github-actions/upload-cloud-storage@v2') + + step.withIf('${{ fromJSON(needs.version.outputs.pr_created) }}') + + step.with({ + path: 'release/images/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar' % name, + destination: '${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images', //TODO: make bucket configurable + process_gcloudignore: false, + }), + ]), + + weeklyDockerPlugin: function( + name, + path, + dockerfile='Dockerfile', + context='release', + platform=[ + 'linux/amd64', + 'linux/arm64', + 'linux/arm', + ] + ) + job.new() + + job.withStrategy({ + matrix: { + platform: platform, + }, + }) + + job.withSteps([ + common.fetchReleaseLib, + common.fetchReleaseRepo, + common.setupNode, + + step.new('Set up QEMU', 'docker/setup-qemu-action@v3'), + step.new('set up docker buildx', 'docker/setup-buildx-action@v3'), + step.new('Login to DockerHub (from vault)', 'grafana/shared-workflows/actions/dockerhub-login@main'), + + releaseStep('Get weekly version') + + step.withId('weekly-version') + + step.withRun(||| + echo "version=$(./tools/image-tag)" >> $GITHUB_OUTPUT + + platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")" + echo "platform=${platform}" >> $GITHUB_OUTPUT + echo "platform_short=$(echo ${{ matrix.platform }} | cut -d / -f 2)" >> $GITHUB_OUTPUT + if [[ "${platform}" == "linux/arm64" ]]; then + echo "plugin_arch=-arm64" >> $GITHUB_OUTPUT + else + echo "plugin_arch=" >> $GITHUB_OUTPUT + fi + |||), + + step.new('Build and export', 'docker/build-push-action@v6') + + step.withTimeoutMinutes('${{ fromJSON(env.BUILD_TIMEOUT) }}') + + step.with({ + context: context, + file: 'release/%s/%s' % [path, dockerfile], + platforms: '${{ matrix.platform }}', + push: false, + tags: '${{ env.IMAGE_PREFIX }}/%s:${{ steps.weekly-version.outputs.version }}' % [name], + outputs: 'type=docker,dest=release/images/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar' % name, + 'build-args': 'IMAGE_TAG=${{ steps.weekly-version.outputs.version }},GOARCH=${{ steps.weekly-version.outputs.platform_short }}', + }), + + releaseStep('Package and push as Docker plugin') + + step.withEnv({ + IMAGE_TAG: '${{ steps.weekly-version.outputs.version }}', + BUILD_DIR: 'release/%s' % [path], + }) + + step.withRun(||| + rm -rf "${{ env.BUILD_DIR }}/rootfs" || true + mkdir "${{ env.BUILD_DIR }}/rootfs" + tar -x -C "${{ env.BUILD_DIR }}/rootfs" -f "release/images/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar" + docker plugin create "${{ env.IMAGE_TAG }}${{ steps.platform.outputs.plugin_arch }}" "${{ env.BUILD_DIR }}" + docker plugin push "${{ env.IMAGE_TAG }}${{ steps.platform.outputs.plugin_arch }}" + |||), + ]), version: job.new() diff --git a/.github/workflows/images.yml b/.github/workflows/images.yml index 40801f19317d3..64dac0158637a 100644 --- a/.github/workflows/images.yml +++ b/.github/workflows/images.yml @@ -329,6 +329,78 @@ "platforms": "linux/amd64,linux/arm64,linux/arm" "push": true "tags": "${{ env.IMAGE_PREFIX }}/loki-canary-boringcrypto:${{ steps.weekly-version.outputs.version }}" + "loki-docker-driver": + "env": + "BUILD_TIMEOUT": 60 + "IMAGE_PREFIX": "grafana" + "RELEASE_LIB_REF": "main" + "RELEASE_REPO": "grafana/loki" + "needs": + - "check" + "runs-on": "ubuntu-latest" + "steps": + - "name": "pull release library code" + "uses": "actions/checkout@v4" + "with": + "path": "lib" + "ref": "${{ env.RELEASE_LIB_REF }}" + "repository": "grafana/loki-release" + - "name": "pull code to release" + "uses": "actions/checkout@v4" + "with": + "path": "release" + "repository": "${{ env.RELEASE_REPO }}" + - "name": "setup node" + "uses": "actions/setup-node@v4" + "with": + "node-version": 20 + - "name": "Set up QEMU" + "uses": "docker/setup-qemu-action@v3" + - "name": "set up docker buildx" + "uses": "docker/setup-buildx-action@v3" + - "name": "Login to DockerHub (from vault)" + "uses": "grafana/shared-workflows/actions/dockerhub-login@main" + - "id": "weekly-version" + "name": "Get weekly version" + "run": | + echo "version=$(./tools/image-tag)" >> $GITHUB_OUTPUT + + platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")" + echo "platform=${platform}" >> $GITHUB_OUTPUT + echo "platform_short=$(echo ${{ matrix.platform }} | cut -d / -f 2)" >> $GITHUB_OUTPUT + if [[ "${platform}" == "linux/arm64" ]]; then + echo "plugin_arch=-arm64" >> $GITHUB_OUTPUT + else + echo "plugin_arch=" >> $GITHUB_OUTPUT + fi + "working-directory": "release" + - "name": "Build and export" + "timeout-minutes": "${{ fromJSON(env.BUILD_TIMEOUT) }}" + "uses": "docker/build-push-action@v6" + "with": + "build-args": "IMAGE_TAG=${{ steps.weekly-version.outputs.version }},GOARCH=${{ steps.weekly-version.outputs.platform_short }}" + "context": "release" + "file": "release/clients/cmd/docker-driver/Dockerfile" + "outputs": "type=docker,dest=release/images/grafana/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar" + "platforms": "${{ matrix.platform }}" + "push": false + "tags": "${{ env.IMAGE_PREFIX }}/grafana/loki-docker-driver:${{ steps.weekly-version.outputs.version }}" + - "env": + "BUILD_DIR": "release/clients/cmd/docker-driver" + "IMAGE_TAG": "${{ steps.weekly-version.outputs.version }}" + "name": "Package and push as Docker plugin" + "run": | + rm -rf "${{ env.BUILD_DIR }}/rootfs" || true + mkdir "${{ env.BUILD_DIR }}/rootfs" + tar -x -C "${{ env.BUILD_DIR }}/rootfs" -f "release/images/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar" + docker plugin create "${{ env.IMAGE_TAG }}${{ steps.platform.outputs.plugin_arch }}" "${{ env.BUILD_DIR }}" + docker plugin push "${{ env.IMAGE_TAG }}${{ steps.platform.outputs.plugin_arch }}" + "working-directory": "release" + "strategy": + "matrix": + "platform": + - "linux/amd64" + - "linux/arm64" "promtail": "env": "BUILD_TIMEOUT": 60 diff --git a/.github/workflows/minor-release-pr.yml b/.github/workflows/minor-release-pr.yml index 807e52afab253..0db833dec9a2f 100644 --- a/.github/workflows/minor-release-pr.yml +++ b/.github/workflows/minor-release-pr.yml @@ -31,6 +31,7 @@ jobs: - "loki" - "loki-canary" - "loki-canary-boringcrypto" + - "loki-docker-driver" - "promtail" - "querytee" runs-on: "ubuntu-latest" @@ -598,6 +599,86 @@ jobs: - "linux/amd64" - "linux/arm64" - "linux/arm" + loki-docker-driver: + needs: + - "version" + runs-on: "ubuntu-latest" + steps: + - name: "pull release library code" + uses: "actions/checkout@v4" + with: + path: "lib" + ref: "${{ env.RELEASE_LIB_REF }}" + repository: "grafana/loki-release" + - name: "pull code to release" + uses: "actions/checkout@v4" + with: + path: "release" + repository: "${{ env.RELEASE_REPO }}" + - name: "setup node" + uses: "actions/setup-node@v4" + with: + node-version: 20 + - name: "auth gcs" + uses: "google-github-actions/auth@v2" + with: + credentials_json: "${{ secrets.GCS_SERVICE_ACCOUNT_KEY }}" + - name: "Set up QEMU" + uses: "docker/setup-qemu-action@v3" + - name: "set up docker buildx" + uses: "docker/setup-buildx-action@v3" + - id: "platform" + name: "parse image platform" + run: | + mkdir -p images + + platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")" + echo "platform=${platform}" >> $GITHUB_OUTPUT + echo "platform_short=$(echo ${{ matrix.platform }} | cut -d / -f 2)" >> $GITHUB_OUTPUT + if [[ "${platform}" == "linux/arm64" ]]; then + echo "plugin_arch=-arm64" >> $GITHUB_OUTPUT + else + echo "plugin_arch=" >> $GITHUB_OUTPUT + fi + working-directory: "release" + - env: + IMAGE_TAG: "${{ needs.version.outputs.version }}" + if: "${{ fromJSON(needs.version.outputs.pr_created) }}" + name: "Build and export" + timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}" + uses: "docker/build-push-action@v6" + with: + build-args: "IMAGE_TAG=${{ needs.version.outputs.version }},GOARCH=${{ steps.platform.outputs.platform_short }}" + context: "release" + file: "release/clients/cmd/docker-driver/Dockerfile" + outputs: "type=docker,dest=release/images/grafana/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar" + platforms: "${{ matrix.platform }}" + push: false + tags: "${{ env.IMAGE_PREFIX }}/grafana/loki-docker-driver:${{ needs.version.outputs.version }}-${{ steps.platform.outputs.platform_short }}" + - env: + BUILD_DIR: "release/clients/cmd/docker-driver" + IMAGE_TAG: "${{ needs.version.outputs.version }}" + if: "${{ fromJSON(needs.version.outputs.pr_created) }}" + name: "Package as Docker plugin" + run: | + rm -rf "${{ env.BUILD_DIR }}/rootfs" || true + mkdir "${{ env.BUILD_DIR }}/rootfs" + tar -x -C "${{ env.BUILD_DIR }}/rootfs" -f "release/images/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar" + docker plugin create "${{ env.IMAGE_TAG }}${{ steps.platform.outputs.plugin_arch }}" "${{ env.BUILD_DIR }}" + working-directory: "release" + - if: "${{ fromJSON(needs.version.outputs.pr_created) }}" + name: "upload artifacts" + uses: "google-github-actions/upload-cloud-storage@v2" + with: + destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images" + path: "release/images/grafana/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar" + process_gcloudignore: false + strategy: + fail-fast: true + matrix: + platform: + - "linux/amd64" + - "linux/arm64" promtail: needs: - "version" diff --git a/.github/workflows/patch-release-pr.yml b/.github/workflows/patch-release-pr.yml index 840f1d1d3f49e..f1b904d22f407 100644 --- a/.github/workflows/patch-release-pr.yml +++ b/.github/workflows/patch-release-pr.yml @@ -31,6 +31,7 @@ jobs: - "loki" - "loki-canary" - "loki-canary-boringcrypto" + - "loki-docker-driver" - "promtail" - "querytee" runs-on: "ubuntu-latest" @@ -598,6 +599,86 @@ jobs: - "linux/amd64" - "linux/arm64" - "linux/arm" + loki-docker-driver: + needs: + - "version" + runs-on: "ubuntu-latest" + steps: + - name: "pull release library code" + uses: "actions/checkout@v4" + with: + path: "lib" + ref: "${{ env.RELEASE_LIB_REF }}" + repository: "grafana/loki-release" + - name: "pull code to release" + uses: "actions/checkout@v4" + with: + path: "release" + repository: "${{ env.RELEASE_REPO }}" + - name: "setup node" + uses: "actions/setup-node@v4" + with: + node-version: 20 + - name: "auth gcs" + uses: "google-github-actions/auth@v2" + with: + credentials_json: "${{ secrets.GCS_SERVICE_ACCOUNT_KEY }}" + - name: "Set up QEMU" + uses: "docker/setup-qemu-action@v3" + - name: "set up docker buildx" + uses: "docker/setup-buildx-action@v3" + - id: "platform" + name: "parse image platform" + run: | + mkdir -p images + + platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")" + echo "platform=${platform}" >> $GITHUB_OUTPUT + echo "platform_short=$(echo ${{ matrix.platform }} | cut -d / -f 2)" >> $GITHUB_OUTPUT + if [[ "${platform}" == "linux/arm64" ]]; then + echo "plugin_arch=-arm64" >> $GITHUB_OUTPUT + else + echo "plugin_arch=" >> $GITHUB_OUTPUT + fi + working-directory: "release" + - env: + IMAGE_TAG: "${{ needs.version.outputs.version }}" + if: "${{ fromJSON(needs.version.outputs.pr_created) }}" + name: "Build and export" + timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}" + uses: "docker/build-push-action@v6" + with: + build-args: "IMAGE_TAG=${{ needs.version.outputs.version }},GOARCH=${{ steps.platform.outputs.platform_short }}" + context: "release" + file: "release/clients/cmd/docker-driver/Dockerfile" + outputs: "type=docker,dest=release/images/grafana/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar" + platforms: "${{ matrix.platform }}" + push: false + tags: "${{ env.IMAGE_PREFIX }}/grafana/loki-docker-driver:${{ needs.version.outputs.version }}-${{ steps.platform.outputs.platform_short }}" + - env: + BUILD_DIR: "release/clients/cmd/docker-driver" + IMAGE_TAG: "${{ needs.version.outputs.version }}" + if: "${{ fromJSON(needs.version.outputs.pr_created) }}" + name: "Package as Docker plugin" + run: | + rm -rf "${{ env.BUILD_DIR }}/rootfs" || true + mkdir "${{ env.BUILD_DIR }}/rootfs" + tar -x -C "${{ env.BUILD_DIR }}/rootfs" -f "release/images/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar" + docker plugin create "${{ env.IMAGE_TAG }}${{ steps.platform.outputs.plugin_arch }}" "${{ env.BUILD_DIR }}" + working-directory: "release" + - if: "${{ fromJSON(needs.version.outputs.pr_created) }}" + name: "upload artifacts" + uses: "google-github-actions/upload-cloud-storage@v2" + with: + destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images" + path: "release/images/grafana/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar" + process_gcloudignore: false + strategy: + fail-fast: true + matrix: + platform: + - "linux/amd64" + - "linux/arm64" promtail: needs: - "version" diff --git a/Makefile b/Makefile index c5afc7b669d64..2942a2409d13a 100644 --- a/Makefile +++ b/Makefile @@ -458,13 +458,17 @@ endif LOKI_DOCKER_DRIVER ?= "grafana/loki-docker-driver" PLUGIN_TAG ?= $(IMAGE_TAG) PLUGIN_ARCH ?= +PLUGIN_BUILD_ARGS ?= +ifeq ("$(PLUGIN_ARCH)", "-arm64") + PLUGIN_BUILD_ARGS = --build-arg GOARCH=arm64 +endif # build-rootfs # builds the plugin rootfs define build-rootfs rm -rf clients/cmd/docker-driver/rootfs || true mkdir clients/cmd/docker-driver/rootfs - docker build --build-arg $(BUILD_IMAGE) -t rootfsimage -f clients/cmd/docker-driver/Dockerfile . + docker build $(PLUGIN_BUILD_ARGS) --build-arg $(BUILD_IMAGE) -t rootfsimage -f clients/cmd/docker-driver/Dockerfile . ID=$$(docker create rootfsimage true) && \ (docker export $$ID | tar -x -C clients/cmd/docker-driver/rootfs) && \ @@ -481,7 +485,7 @@ docker-driver: docker-driver-clean ## build the docker-driver executable docker plugin create $(LOKI_DOCKER_DRIVER):main$(PLUGIN_ARCH) clients/cmd/docker-driver clients/cmd/docker-driver/docker-driver: - CGO_ENABLED=0 go build $(GO_FLAGS) -o $@ ./$(@D) + CGO_ENABLED=0 GOARCH=$(GOARCH) go build $(GO_FLAGS) -o $@ ./$(@D) docker-driver-push: docker-driver ifndef DOCKER_PASSWORD diff --git a/clients/cmd/docker-driver/Dockerfile b/clients/cmd/docker-driver/Dockerfile index 672556240f19b..b2a2ba8069857 100644 --- a/clients/cmd/docker-driver/Dockerfile +++ b/clients/cmd/docker-driver/Dockerfile @@ -1,16 +1,29 @@ ARG BUILD_IMAGE=grafana/loki-build-image:0.34.0 +ARG GOARCH=amd64 # Directories in this file are referenced from the root of the project not this folder # This file is intended to be called from the root like so: -# docker build -t grafana/loki -f cmd/loki/Dockerfile . +# docker build -t grafana/loki-docker-driver -f clients/cmd/docker-driver/Dockerfile . -# TODO: add cross-platform support FROM $BUILD_IMAGE AS build COPY . /src/loki WORKDIR /src/loki -RUN make clean && make BUILD_IN_CONTAINER=false clients/cmd/docker-driver/docker-driver -FROM alpine:3.20.3 -RUN apk add --update --no-cache ca-certificates tzdata +ARG GOARCH +RUN make clean && make BUILD_IN_CONTAINER=false GOARCH=${GOARCH} clients/cmd/docker-driver/docker-driver + +FROM alpine:3.20.3 AS temp + +ARG GOARCH + +RUN apk add --update --no-cache --arch=${GOARCH} ca-certificates tzdata + +FROM --platform=linux/${GOARCH} alpine:3.20.3 + +COPY --from=temp /etc/ca-certificates.conf /etc/ca-certificates.conf +COPY --from=temp /usr/share/ca-certificates /usr/share/ca-certificates +COPY --from=temp /usr/share/zoneinfo /usr/share/zoneinfo + COPY --from=build /src/loki/clients/cmd/docker-driver/docker-driver /bin/docker-driver + WORKDIR /bin/ ENTRYPOINT [ "/bin/docker-driver" ] diff --git a/docs/sources/send-data/docker-driver/_index.md b/docs/sources/send-data/docker-driver/_index.md index 092857732c807..5fdb9c208eecd 100644 --- a/docs/sources/send-data/docker-driver/_index.md +++ b/docs/sources/send-data/docker-driver/_index.md @@ -31,6 +31,9 @@ Run the following command to install the plugin, updating the release version if ```bash docker plugin install grafana/loki-docker-driver:2.9.2 --alias loki --grant-all-permissions ``` +{{% admonition type="note" %}} +Add `-arm64` to the image tag for AMR64 hosts. +{{% /admonition %}} To check installed plugins, use the `docker plugin ls` command. Plugins that have started successfully are listed as enabled: