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

Linux arm #1

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
platforms: arm64,arm

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
Expand Down
52 changes: 52 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ builds:
- "386"
- amd64
- arm64
- arm
ignore:
- goos: darwin
goarch: "386"
- goos: darwin
goarch: arm
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
dir: distributions/otelcol/_build
Expand All @@ -32,9 +37,14 @@ builds:
- "386"
- amd64
- arm64
- arm
ignore:
- goos: darwin
goarch: "386"
- goos: darwin
goarch: arm
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
dir: distributions/otelcol-contrib/_build
Expand Down Expand Up @@ -163,6 +173,24 @@ dockers:
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: arm
dockerfile: distributions/otelcol/Dockerfile
image_templates:
- otel/opentelemetry-collector:{{ .Version }}-arm
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{
.Version }}-arm
extra_files:
- configs/otelcol.yaml
build_flag_templates:
- --pull
- --platform=linux/arm
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.name={{.ProjectName}}
- --label=org.opencontainers.image.revision={{.FullCommit}}
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: "386"
dockerfile: distributions/otelcol-contrib/Dockerfile
Expand Down Expand Up @@ -217,12 +245,31 @@ dockers:
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: arm
dockerfile: distributions/otelcol-contrib/Dockerfile
image_templates:
- otel/opentelemetry-collector-contrib:{{ .Version }}-arm
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{
.Version }}-arm
extra_files:
- configs/otelcol-contrib.yaml
build_flag_templates:
- --pull
- --platform=linux/arm
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.name={{.ProjectName}}
- --label=org.opencontainers.image.revision={{.FullCommit}}
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
docker_manifests:
- name_template: otel/opentelemetry-collector:{{ .Version }}
image_templates:
- otel/opentelemetry-collector:{{ .Version }}-386
- otel/opentelemetry-collector:{{ .Version }}-amd64
- otel/opentelemetry-collector:{{ .Version }}-arm64
- otel/opentelemetry-collector:{{ .Version }}-arm
- name_template: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{
.Version }}
image_templates:
Expand All @@ -232,11 +279,14 @@ docker_manifests:
.Version }}-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{
.Version }}-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{
.Version }}-arm
- name_template: otel/opentelemetry-collector-contrib:{{ .Version }}
image_templates:
- otel/opentelemetry-collector-contrib:{{ .Version }}-386
- otel/opentelemetry-collector-contrib:{{ .Version }}-amd64
- otel/opentelemetry-collector-contrib:{{ .Version }}-arm64
- otel/opentelemetry-collector-contrib:{{ .Version }}-arm
- name_template: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{
.Version }}
image_templates:
Expand All @@ -246,3 +296,5 @@ docker_manifests:
.Version }}-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{
.Version }}-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{
.Version }}-arm
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ make goreleaser-verify

#### Building multi-architecture Docker images

goreleaser will build Docker images for x86_64 and arm64 processors. The build process involves executing `RUN` steps on the target architecture, which means the system you run it on needs support for emulating foreign architectures.
goreleaser will build Docker images for x86_64, 386 arm64 and arm processors. The build process involves executing `RUN` steps on the target architecture, which means the system you run it on needs support for emulating foreign architectures.

This is accomplished by installing [qemu](https://www.qemu.org/), and then [enabling support](https://github.com/multiarch/qemu-user-static#readme) for qemu within Docker:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This repository assembles OpenTelemetry Collector distributions, such as the "co
Each distribution contains:

- Binaries for a multitude of platforms and architectures
- Multi-arch container images (x86_64 and arm64)
- Multi-arch container images (x86_64, 386, arm64 and arm)
- Packages to be used with Linux distributions (apk, RPM, deb), Mac OS (brew)

More details about each individual distribution can be seen in its own readme files.
Expand Down
4 changes: 3 additions & 1 deletion goreleaser/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

var (
ImagePrefixes = []string{"otel", "ghcr.io/open-telemetry/opentelemetry-collector-releases"}
Architectures = []string{"386", "amd64", "arm64"}
Architectures = []string{"386", "amd64", "arm64", "arm"}

distsFlag = flag.String("d", "", "Collector distributions(s) to build, comma-separated")
)
Expand Down Expand Up @@ -80,6 +80,8 @@ func Build(dist string) config.Build {
Goarch: Architectures,
Ignore: []config.IgnoredBuild{
{Goos: "darwin", Goarch: "386"},
{Goos: "darwin", Goarch: "arm"},
{Goos: "windows", Goarch: "arm"},
{Goos: "windows", Goarch: "arm64"},
},
}
Expand Down