-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #708 from openziti/debug-builder
target armhf for arm/v7 32bit build; add armel build instructions
- Loading branch information
Showing
13 changed files
with
218 additions
and
115 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
version: 2 | ||
builds: | ||
- id: zrok-amd64 | ||
main: ./cmd/zrok | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
version: 2 | ||
builds: | ||
- id: zrok-amd64 | ||
main: ./cmd/zrok | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
version: 2 | ||
builds: | ||
- id: zrok-armv8 | ||
main: ./cmd/zrok | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
# this is a DiY build config for the soft-float, armel platform (32bit ARMv7 devices lacking an FPU) see | ||
# instructions to cross-build this binary in ./docker/images/cross-build/README.md or | ||
# https://github.com/openziti/zrok/tree/main/docker/images/cross-build#readme | ||
version: 2 | ||
builds: | ||
- id: zrok-armel | ||
main: ./cmd/zrok | ||
binary: zrok | ||
ldflags: | ||
- "-s -w -X github.com/openziti/zrok/build.Version={{.Tag}} -X github.com/openziti/zrok/build.Hash={{.ShortCommit}}" | ||
env: | ||
- CC=arm-linux-gnueabi-gcc | ||
- CGO_ENABLED=1 | ||
- CC_FOR_TARGET=gcc-arm-linux-gnueabi | ||
goos: | ||
- linux | ||
goarch: | ||
- arm | ||
goarm: | ||
- 7 | ||
|
||
nfpms: | ||
- package_name: zrok | ||
id: zrok-cli | ||
vendor: NetFoundry | ||
homepage: https://zrok.io/ | ||
maintainer: [email protected] | ||
description: |- | ||
zrok is a next-generation sharing platform, designed to make sharing network and file resources simple and | ||
secure. | ||
license: Apache 2.0 | ||
|
||
# Build IDs for the builds you want to create NFPM packages for. | ||
builds: | ||
- zrok-armel | ||
|
||
# Formats to be generated. | ||
formats: | ||
- deb | ||
- rpm | ||
|
||
# {{ .ConventionalFileName }} satisfies the RPM name convention. | ||
file_name_template: "{{ .ConventionalFileName }}" | ||
|
||
# Umask to be used on files without explicit mode set. (overridable) | ||
umask: 0o002 | ||
|
||
# Package version within this release version. | ||
release: 1 | ||
|
||
# Section. | ||
section: default | ||
|
||
# Priority. | ||
priority: optional | ||
|
||
# GoReleaser will automatically add the binaries here | ||
bindir: /opt/openziti/bin | ||
|
||
# Contents to add to the package. | ||
contents: | ||
- src: /opt/openziti/bin/zrok | ||
dst: /usr/bin/zrok | ||
type: "symlink" | ||
|
||
- package_name: zrok-share | ||
id: zrok-share | ||
vendor: NetFoundry | ||
homepage: https://zrok.io/ | ||
maintainer: [email protected] | ||
description: |- | ||
This package provides zrok-share.service. To enable, edit the "/opt/openziti/etc/zrok/zrok-share.env" file with the | ||
desired target for sharing, and run "systemctl enable --now zrok-share.service". | ||
license: Apache 2.0 | ||
|
||
# do not bundle the built binaries, only supporting files | ||
meta: true | ||
|
||
# Formats to be generated. | ||
formats: | ||
- deb | ||
- rpm | ||
|
||
# {{ .ConventionalFileName }} satisfies the RPM name convention. | ||
file_name_template: "{{ .ConventionalFileName }}" | ||
|
||
# Umask to be used on files without explicit mode set. (overridable) | ||
umask: 0o002 | ||
|
||
# Package version within this release version. | ||
release: 1 | ||
|
||
# Section. | ||
section: default | ||
|
||
# Priority. | ||
priority: optional | ||
|
||
# GoReleaser will automatically add the binaries here | ||
dependencies: | ||
- zrok | ||
|
||
# this allows users to satisfy the requirement for jq another way, not with the package manager, e.g. | ||
# apt install --no-recommends zrok-share | ||
recommends: | ||
- jq | ||
|
||
overrides: | ||
# yum and dnf do not automatically install "weak deps" aka "recommends", so we need to add them as a dependency | ||
rpm: | ||
dependencies: | ||
- zrok | ||
- jq | ||
|
||
# Contents to add to the package. | ||
contents: | ||
- dst: /lib/systemd/system/ | ||
src: ./nfpm/zrok-share.service | ||
|
||
- dst: /etc/systemd/system/zrok-share.service.d/override.conf | ||
src: ./nfpm/zrok-share.service.override.conf | ||
|
||
- dst: /opt/openziti/etc/zrok | ||
type: dir | ||
file_info: | ||
mode: 0755 | ||
|
||
- dst: /opt/openziti/bin/ | ||
src: ./nfpm/zrok-share.bash | ||
file_info: | ||
mode: 0755 | ||
|
||
- dst: /opt/openziti/bin/ | ||
src: ./nfpm/zrok-enable.bash | ||
file_info: | ||
mode: 0755 | ||
|
||
- dst: /opt/openziti/etc/zrok/ | ||
src: ./nfpm/zrok-share.env | ||
type: config|noreplace | ||
|
||
- dst: /opt/openziti/etc/zrok/ | ||
src: ./etc/caddy/multiple_upstream.Caddyfile | ||
type: config|noreplace |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
version: 2 | ||
builds: | ||
- skip: true | ||
release: | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
version: 2 | ||
builds: | ||
- main: ./cmd/zrok | ||
binary: zrok | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,48 @@ | ||
# Stage 1: Install Node.js with nvm | ||
FROM debian:bullseye-slim | ||
FROM goreleaser/goreleaser AS goreleaser | ||
|
||
FROM golang:1.21 AS golang | ||
|
||
FROM debian:bookworm-slim | ||
# | ||
# this file mirrors the build params used in the GitHub Actions and enables | ||
# reproducible builds for downstream forks for Ziti contributors | ||
# | ||
|
||
ARG TARGETARCH | ||
ARG golang_version=1.21.3 | ||
ARG go_distribution_file=go${golang_version}.linux-${TARGETARCH}.tar.gz | ||
ARG go_path=/usr/share/go | ||
ARG go_root=/usr/local/go | ||
ARG go_cache=/usr/share/go_cache | ||
ARG uid=1000 | ||
ARG gid=1000 | ||
ARG go_cache=/usr/share/go | ||
|
||
RUN apt-get -y update \ | ||
&& apt-get -y install \ | ||
gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf gcc-aarch64-linux-gnu \ | ||
wget build-essential | ||
gcc-arm-linux-gnueabi \ | ||
gcc-arm-linux-gnueabihf \ | ||
gcc-aarch64-linux-gnu \ | ||
wget \ | ||
git \ | ||
build-essential | ||
|
||
RUN wget -q https://go.dev/dl/${go_distribution_file} | ||
RUN tar -xzf ${go_distribution_file} -C /usr/local/ | ||
|
||
RUN wget -qO- https://deb.nodesource.com/setup_18.x | bash \ | ||
&& apt-get -y update \ | ||
&& apt-get -y install \ | ||
nodejs | ||
|
||
RUN mkdir ${go_path} ${go_cache} | ||
RUN chown -R ${uid}:${gid} ${go_path} ${go_cache} | ||
|
||
COPY ./linux-build.sh /usr/local/bin/ | ||
COPY --from=golang /usr/local/go /usr/local/go | ||
# RUN chmod -R go+rX ${go_path} ${go_cache} | ||
|
||
COPY --from=goreleaser /usr/bin/goreleaser /usr/local/bin/goreleaser | ||
|
||
COPY ./linux-build.sh /usr/local/bin/linux-build.sh | ||
|
||
USER ${uid}:${gid} | ||
ENV TARGETARCH=${TARGETARCH} | ||
ENV GOPATH=${go_path} | ||
ENV GOROOT=${go_root} | ||
ENV GOCACHE=${go_cache} | ||
ENV PATH=${go_path}/bin:${go_root}/bin:$PATH | ||
|
||
RUN go install github.com/mitchellh/gox@latest | ||
WORKDIR /mnt | ||
ENTRYPOINT ["linux-build.sh"] | ||
|
This file contains 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
Oops, something went wrong.