From e794d8404d353bb6f7de123321734fb291025486 Mon Sep 17 00:00:00 2001 From: Shane Utt Date: Mon, 3 Feb 2020 16:12:47 -0500 Subject: [PATCH] Add ARM container builds (#2227) Signed-off-by: Shane Utt --- Dockerfile-velero-arm | 23 ++++++++++++++++++ Dockerfile-velero-arm64 | 23 ++++++++++++++++++ Dockerfile-velero-restic-restore-helper-arm | 21 ++++++++++++++++ Dockerfile-velero-restic-restore-helper-arm64 | 21 ++++++++++++++++ Makefile | 24 ++++++++++++------- changelogs/unreleased/2227-shaneutt | 1 + 6 files changed, 105 insertions(+), 8 deletions(-) create mode 100644 Dockerfile-velero-arm create mode 100644 Dockerfile-velero-arm64 create mode 100644 Dockerfile-velero-restic-restore-helper-arm create mode 100644 Dockerfile-velero-restic-restore-helper-arm64 create mode 100644 changelogs/unreleased/2227-shaneutt diff --git a/Dockerfile-velero-arm b/Dockerfile-velero-arm new file mode 100644 index 000000000..2fa28046e --- /dev/null +++ b/Dockerfile-velero-arm @@ -0,0 +1,23 @@ +# Copyright 2020 the Velero contributors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM arm32v7/ubuntu:bionic + +ADD /bin/linux/arm/restic /usr/bin/restic + +ADD /bin/linux/arm/velero /velero + +USER nobody:nogroup + +ENTRYPOINT ["/velero"] diff --git a/Dockerfile-velero-arm64 b/Dockerfile-velero-arm64 new file mode 100644 index 000000000..e92732292 --- /dev/null +++ b/Dockerfile-velero-arm64 @@ -0,0 +1,23 @@ +# Copyright 2020 the Velero contributors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM arm64v8/ubuntu:bionic + +ADD /bin/linux/arm64/restic /usr/bin/restic + +ADD /bin/linux/arm64/velero /velero + +USER nobody:nogroup + +ENTRYPOINT ["/velero"] diff --git a/Dockerfile-velero-restic-restore-helper-arm b/Dockerfile-velero-restic-restore-helper-arm new file mode 100644 index 000000000..aa0ead6c2 --- /dev/null +++ b/Dockerfile-velero-restic-restore-helper-arm @@ -0,0 +1,21 @@ +# Copyright 2020 the Velero contributors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM arm32v7/ubuntu:bionic + +ADD /bin/linux/arm/velero-restic-restore-helper . + +USER nobody:nogroup + +ENTRYPOINT [ "/velero-restic-restore-helper" ] diff --git a/Dockerfile-velero-restic-restore-helper-arm64 b/Dockerfile-velero-restic-restore-helper-arm64 new file mode 100644 index 000000000..b42220d0a --- /dev/null +++ b/Dockerfile-velero-restic-restore-helper-arm64 @@ -0,0 +1,21 @@ +# Copyright 2020 the Velero contributors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM arm64v8/ubuntu:bionic + +ADD /bin/linux/arm64/velero-restic-restore-helper . + +USER nobody:nogroup + +ENTRYPOINT [ "/velero-restic-restore-helper" ] diff --git a/Makefile b/Makefile index 08e8656c9..810e41260 100644 --- a/Makefile +++ b/Makefile @@ -37,8 +37,8 @@ TAG_LATEST ?= false RESTIC_VERSION ?= 0.9.6 CLI_PLATFORMS ?= linux-amd64 linux-arm linux-arm64 darwin-amd64 windows-amd64 linux-ppc64le -CONTAINER_PLATFORMS ?= linux-amd64 linux-ppc64le #linux-arm linux-arm64 -MANIFEST_PLATFORMS ?= amd64 ppc64le +CONTAINER_PLATFORMS ?= linux-amd64 linux-ppc64le linux-arm linux-arm64 +MANIFEST_PLATFORMS ?= amd64 ppc64le arm arm64 ### ### These variables should not need tweaking. @@ -54,12 +54,20 @@ ifeq ($(GOARCH),amd64) local-arch: @echo "local environment for amd64 is up-to-date" endif -#ifeq ($(GOARCH),arm) -# DOCKERFILE ?= Dockerfile.arm #armel/busybox -#endif -#ifeq ($(GOARCH),arm64) -# DOCKERFILE ?= Dockerfile.arm64 #aarch64/busybox -#endif +ifeq ($(GOARCH),arm) + DOCKERFILE ?= Dockerfile-$(BIN)-arm +local-arch: + @mkdir -p _output/bin/linux/arm/ + @wget -q -O - https://github.com/restic/restic/releases/download/v$(RESTIC_VERSION)/restic_$(RESTIC_VERSION)_linux_arm.bz2 | bunzip2 > _output/bin/linux/arm/restic + @chmod a+x _output/bin/linux/arm/restic +endif +ifeq ($(GOARCH),arm64) + DOCKERFILE ?= Dockerfile-$(BIN)-arm64 +local-arch: + @mkdir -p _output/bin/linux/arm64/ + @wget -q -O - https://github.com/restic/restic/releases/download/v$(RESTIC_VERSION)/restic_$(RESTIC_VERSION)_linux_arm64.bz2 | bunzip2 > _output/bin/linux/arm64/restic + @chmod a+x _output/bin/linux/arm64/restic +endif ifeq ($(GOARCH),ppc64le) DOCKERFILE ?= Dockerfile-$(BIN)-ppc64le local-arch: diff --git a/changelogs/unreleased/2227-shaneutt b/changelogs/unreleased/2227-shaneutt new file mode 100644 index 000000000..2813bae52 --- /dev/null +++ b/changelogs/unreleased/2227-shaneutt @@ -0,0 +1 @@ +added support for arm and arm64 images