Files
ziti/Dockerfile.linux-build
T
Kenneth Bingham 3ac5d55204 add a Dockerfile and shell script for reproducible Linux builds of all Ziti artifacts to enable forks and contributors who can't run ziti-ci
Release v0.22.12

always build the Linux container with latest Go

Use go install instead of go get

reconcile upstream's main workflow

reconcile upstream's common/version/info_generated.go
2021-11-22 11:36:06 -05:00

71 lines
2.1 KiB
Docker
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
FROM ubuntu:18.04
#
# this file mirrors the build params used in the GitHub Actions and enables
# reproducible builds for downstream forks and Ziti contributors
#
ARG latest_golang=1.17.2
ARG go_distribution_file=go${latest_golang}.linux-amd64.tar.gz
ARG GOPATH=/root/go
ARG GOROOT=/usr/local/go
RUN apt-get update
RUN apt-get -yq install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf gcc-aarch64-linux-gnu
RUN apt-get -yq install wget build-essential
RUN wget -q https://golang.org/dl/${go_distribution_file}
RUN tar -xzf ${go_distribution_file} -C /usr/local/
RUN mkdir ${GOPATH}
ENV GOPATH=${GOPATH}
ENV GOROOT=${GOROOT}
ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH
RUN go install github.com/mitchellh/gox@latest
WORKDIR /mnt
CMD ["./linux-build.sh"]
##
# build this Dockerfile
##
#
# MINIMUM_GOLANG=$(grep -Po '^go\s+\K\d+\.\d+(\.\d+)?$' go.mod)
# LATEST_GOLANG=$(curl -sSf "https://golang.org/VERSION?m=text" | /bin/grep -Po '^go(\s+)?\K\d+\.\d+\.\d+$')
# docker build --tag=zitibuilder --file=Dockerfile.linux-build --build-arg latest_golang=${LATEST_GOLANG} .
##
# build Ziti
##
# docker run --rm --name=zitibuilder --volume=$PWD:/mnt zitibuilder
# $ tree ./release
# ./release
# ├── amd64
# │   └── linux
# │   ├── ziti
# │   ├── ziti-controller
# │   ├── ziti-fabric
# │   ├── ziti-fabric-gw
# │   ├── ziti-fabric-test
# │   ├── ziti-probe
# │   ├── ziti-router
# │   └── ziti-tunnel
# ├── arm
# │   └── linux
# │   ├── ziti
# │   ├── ziti-controller
# │   ├── ziti-fabric
# │   ├── ziti-fabric-gw
# │   ├── ziti-fabric-test
# │   ├── ziti-probe
# │   ├── ziti-router
# │   └── ziti-tunnel
# └── arm64
# └── linux
# ├── ziti
# ├── ziti-controller
# ├── ziti-fabric
# ├── ziti-fabric-gw
# ├── ziti-fabric-test
# ├── ziti-probe
# ├── ziti-router
# └── ziti-tunnel
# 6 directories, 24 files