mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
Merge pull request #177 from firezone/buildx-weirdness
solved some buildx issues
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
set -e
|
||||
|
||||
base_image="ghcr.io/firezone/${MATRIX_IMAGE}"
|
||||
tag=release-${MATRIX_IMAGE}
|
||||
tag="ghcr.io/firezone/release-${MATRIX_IMAGE}"
|
||||
|
||||
case $MATRIX_IMAGE in
|
||||
amazonlinux*)
|
||||
@@ -25,6 +25,7 @@ esac
|
||||
|
||||
# Build intermediate release image
|
||||
docker buildx build \
|
||||
--push \
|
||||
-f pkg/Dockerfile.release \
|
||||
-t $tag \
|
||||
--platform linux/amd64 \
|
||||
@@ -38,10 +39,11 @@ case $format in
|
||||
deb)
|
||||
pkg_dir="${MATRIX_IMAGE/:/_}_amd64"
|
||||
pkg_file="${pkg_dir}.deb"
|
||||
image="${pkg_dir}:latest"
|
||||
image="ghcr.io/firezone/${pkg_dir}:latest"
|
||||
|
||||
docker buildx build \
|
||||
-t $image \
|
||||
--push \
|
||||
--tag $image \
|
||||
-f pkg/Dockerfile.deb \
|
||||
--platform linux/amd64 \
|
||||
--build-arg PKG_DIR=$pkg_dir \
|
||||
@@ -56,11 +58,12 @@ case $format in
|
||||
|
||||
rpm)
|
||||
version=0.2.0-1
|
||||
pkg_dir="firezone-${version}.amd64"
|
||||
pkg_dir="firezone-${version}.x86_64"
|
||||
pkg_file="${pkg_dir}.rpm"
|
||||
image="${MATRIX_IMAGE/:/_}_amd64:latest"
|
||||
image="ghcr.io/firezone/${MATRIX_IMAGE/:/_}_amd64:latest"
|
||||
|
||||
docker buildx build \
|
||||
--push \
|
||||
-t $image \
|
||||
-f pkg/Dockerfile.rpm \
|
||||
--platform linux/amd64 \
|
||||
@@ -71,6 +74,6 @@ case $format in
|
||||
|
||||
cid=$(docker create $image)
|
||||
mkdir -p _build
|
||||
docker cp $cid:/root/rpmbuild/RPMS/amd64/$pkg_file ./_build/$pkg_file
|
||||
docker cp $cid:/root/rpmbuild/RPMS/x86_64/$pkg_file ./_build/$pkg_file
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -11,3 +11,8 @@ apps/fg_vpn/_build
|
||||
docs
|
||||
|
||||
.DS_Store
|
||||
|
||||
.git
|
||||
|
||||
# buildx ignores stuff that git ls-files doesn't show, so we need these
|
||||
!deps
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
erlang 24.0.3
|
||||
nodejs 14.17.3
|
||||
elixir 1.12.2-otp-24
|
||||
nodejs lts
|
||||
erlang 24.0.3
|
||||
|
||||
@@ -34,6 +34,7 @@ ENV PATH="/root/.asdf/bin:/root/.asdf/shims:${PATH}"
|
||||
RUN echo 'PATH="/root/.asdf/bin:/root/.asdf/shims:${PATH}"' >> /etc/environment
|
||||
COPY .tool-versions .tool-versions
|
||||
RUN asdf plugin-add nodejs
|
||||
RUN asdf plugin-update nodejs
|
||||
RUN asdf plugin-add erlang
|
||||
RUN asdf plugin-add elixir
|
||||
RUN asdf install
|
||||
|
||||
@@ -21,7 +21,7 @@ RUN npm run --prefix ./apps/fz_http/assets deploy && \
|
||||
cd apps/fz_http && mix phx.digest
|
||||
# Copy remaining items for release
|
||||
COPY rel rel
|
||||
COPY deps deps
|
||||
COPY config config
|
||||
COPY apps apps
|
||||
COPY deps deps
|
||||
RUN mix release
|
||||
|
||||
@@ -7,5 +7,6 @@ ARG PKG_DIR
|
||||
COPY pkg/rpm_shared/rpmbuild rpmbuild
|
||||
COPY pkg/skel/ rpmbuild/BUILDROOT/$PKG_DIR/
|
||||
RUN rsync -az _build/prod/rel/firezone/* rpmbuild/BUILDROOT/$PKG_DIR/usr/lib/firezone/
|
||||
RUN mkdir -p rpmbuild/BUILDROOT/$PKG_DIR/usr/bin
|
||||
RUN cd rpmbuild/BUILDROOT/$PKG_DIR/usr/bin && ln -s ../lib/firezone/bin/firezone
|
||||
RUN rpmbuild -bb rpmbuild/SPECS/firezone.spec
|
||||
|
||||
@@ -14,19 +14,18 @@ elif [ `uname -m` = "arm64" ]; then
|
||||
docker buildx create --use
|
||||
fi
|
||||
|
||||
matrix_images=(
|
||||
amazonlinux:2
|
||||
centos:7
|
||||
centos:8
|
||||
fedora:33
|
||||
fedora:34
|
||||
fedora:35
|
||||
debian:10
|
||||
ubuntu:18.04
|
||||
ubuntu:20.04
|
||||
declare -a matrix_images=("amazonlinux:2"
|
||||
"centos:7"
|
||||
"centos:8"
|
||||
"fedora:33"
|
||||
"fedora:34"
|
||||
"fedora:35"
|
||||
"debian:10"
|
||||
"ubuntu:18.04"
|
||||
"ubuntu:20.04"
|
||||
)
|
||||
|
||||
for image in $matrix_images; do
|
||||
for image in "${matrix_images[@]}"; do
|
||||
export MATRIX_IMAGE=$image
|
||||
.ci/build_base.sh
|
||||
.ci/build_packages.sh
|
||||
|
||||
Reference in New Issue
Block a user