Skip to content
Merged
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
1 change: 1 addition & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ template: |
- `docker.elastic.co/beats-dev/golang-crossbuild:$RESOLVED_VERSION-main-debian11` - linux/i386, linux/amd64, windows/amd64
- `docker.elastic.co/beats-dev/golang-crossbuild:$RESOLVED_VERSION-main-debian12` - linux/i386, linux/amd64, windows/amd64
- `docker.elastic.co/beats-dev/golang-crossbuild:$RESOLVED_VERSION-mips-debian12` - linux/mips64, linux/mips64el
- `docker.elastic.co/beats-dev/golang-crossbuild:$RESOLVED_VERSION-ppc-debian12` - linux/ppc64, linux/ppc64le
- `docker.elastic.co/beats-dev/golang-crossbuild:$RESOLVED_VERSION-s390x-debian12` - linux/s390x

### Changes
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ Replace `<GOLANG_VERSION>` with the version you would like to use, for instance:
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-mips-debian11` - linux/mips64, linux/mips64el
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-mips-debian12` - linux/mips64, linux/mips64el
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-mips32` - linux/mips, linux/mipsle **NOTE**: it does not exist from Golang versions > `1.18.5`/`1.17.12`.
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-ppc-debian12` - linux/ppc64, linux/ppc64le **NOTE**: it does not exist from Golang versions >= `1.23.6`.
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-ppc-debian11` - linux/ppc64, linux/ppc64le
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-ppc-debian12` - linux/ppc64, linux/ppc64le
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-s390x-debian11` - linux/s390x
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-s390x-debian12` - linux/s390x

Expand All @@ -81,7 +82,7 @@ Replace `<GOLANG_VERSION>` with the version you would like to use, for instance:

## Old Build Tags

Until Golang version `1.15`
Until Golang version 1.15

| Description | Tags for 1.10 | Tags for 1.11 | Tags for 1.12 | Tags for 1.13 | Tags for 1.14 | Tags for 1.15 |
| ------------- | -----| ------- | ----- | ------ | ------ | ------ |
Expand Down Expand Up @@ -343,6 +344,11 @@ It is used to cross compile for `linux/mips`. This Docker image is based on the
The `mips32` image is the base image for the `mips32` architecture, it is build for Debian 11+.
It is used to cross compile for `linux/mips32`. This Docker image is based on the `base` image.

## go/ppc Docker image

The `ppc` image is the base image for the `ppc` architecture, it is build for Debian 12+.
It is used to cross compile for `linux/ppc`. This Docker image is based on the `base` image.

## go/s390x Docker image

The `s390x` image is the base image for the `s390x` architecture, it is build for Debian 12+.
Expand Down
2 changes: 1 addition & 1 deletion go/Makefile.debian12
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
IMAGES := base main darwin arm armhf armel mips s390x darwin-arm64 npcap
IMAGES := base main darwin arm armhf armel mips ppc s390x darwin-arm64 npcap
DEBIAN_VERSION := 12
TAG_EXTENSION := -debian12

Expand Down
1 change: 1 addition & 0 deletions go/ppc/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Makefile
83 changes: 83 additions & 0 deletions go/ppc/Dockerfile.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
ARG REPOSITORY
ARG VERSION
ARG TAG_EXTENSION=''
FROM ${REPOSITORY}/golang-crossbuild:${VERSION}-base${TAG_EXTENSION}

RUN dpkg --add-architecture ppc64el \
&& apt update -y --no-install-recommends \
&& apt upgrade -y --no-install-recommends \
&& apt full-upgrade -y --no-install-recommends \
&& apt install -qq -y --no-install-recommends \
g++-powerpc64-linux-gnu \
gcc-powerpc64-linux-gnu \
crossbuild-essential-ppc64el

RUN apt install -qq -y \
libc-dev:ppc64el \
libpopt-dev:ppc64el \
linux-libc-dev:ppc64el

{{- if eq .DEBIAN_VERSION "9" }}
RUN apt install -qq -y \
libelf1:ppc64el \
libicu-dev:ppc64el \
libicu57:ppc64el \
librpm-dev:ppc64el \
libxml2-dev:ppc64el \
libxml2:ppc64el \
librpm3:ppc64el \
librpmio3:ppc64el \
librpmbuild3:ppc64el \
librpmsign3:ppc64el \
libsqlite3-dev:ppc64el \
libnss3:ppc64el \
libsqlite3-0:ppc64el

# RUN apt install -y \
# libsystemd-dev:ppc64el libsystemd0:ppc64el liblz4-1:ppc64el
{{- end }}

{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11") (eq .DEBIAN_VERSION "12")}}
# librpm-dev
RUN apt install -y \
librpm-dev:ppc64el

# libsystemd-dev
RUN apt install -y \
libsystemd-dev:ppc64el
{{- end }}

RUN rm -rf /var/lib/apt/lists/*

COPY rootfs /

# Basic test
RUN cd / \
&& powerpc64le-linux-gnu-gcc helloWorld.c -o helloWorld \
&& file helloWorld \
&& readelf -h helloWorld \
&& readelf -h helloWorld | grep -c 'PowerPC64' \
&& readelf -h helloWorld | grep -c 'ELF64' \
&& readelf -h helloWorld | grep -c "little endian" \
&& rm helloWorld.c helloWorld

RUN cd /libpcap/libpcap-1.8.1 \
&& cp -R /libpcap/libpcap-1.8.1 /libpcap/libpcap-1.8.1-ppc64 \
&& cp -R /libpcap/libpcap-1.8.1 /libpcap/libpcap-1.8.1-ppc64el \
&& cd /libpcap/libpcap-1.8.1-ppc64 \
&& CC=powerpc64-linux-gnu-gcc ./configure --enable-usb=no --enable-bluetooth=no --enable-dbus=no --host=ppc64-unknown-linux-gnu --with-pcap=linux \
&& make \
&& cd /libpcap/libpcap-1.8.1-ppc64el \
&& CC=powerpc64le-linux-gnu-gcc ./configure --enable-usb=no --enable-bluetooth=no --enable-dbus=no --host=ppc64el-unknown-linux-gnu --with-pcap=linux \
&& make

# Build-time metadata as defined at http://label-schema.org.
ARG BUILD_DATE
ARG IMAGE
ARG VCS_REF
ARG VCS_URL
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name=$IMAGE \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url=$VCS_URL \
org.label-schema.schema-version="1.0"
1 change: 1 addition & 0 deletions go/ppc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../Makefile.common
9 changes: 9 additions & 0 deletions go/ppc/rootfs/compilers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---

linux:
ppc64:
CC: powerpc64-linux-gnu-gcc
CXX: powerpc64-linux-gnu-g++
ppc64le:
CC: powerpc64le-linux-gnu-gcc
CXX: powerpc64le-linux-gnu-g++
5 changes: 5 additions & 0 deletions go/ppc/rootfs/helloWorld.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include <stdio.h>
int main() {
printf("Hello, World!");
return 0;
}