Skip to content

Instantly share code, notes, and snippets.

View kainlite's full-sized avatar
:shipit:

Gabriel Garrido kainlite

:shipit:
View GitHub Profile
❯ buildah push f9fe5e59b8d docker-daemon:rcv:f9fe5e59b8d
Getting image source signatures
Copying blob b74e98d1b921 done
Copying blob 6c3d1ef471ee done
Copying blob 403a5f26ee02 done
Copying blob d55191df9034 done
Copying blob 1f4f3f20d97e done
Copying blob 54a3ca211559 done
Copying blob 7fd29dd92a8e done
Copying config f9fe5e59b8 done
❯ buildah build -f Dockerfile.armv7v2 .
[1/2] STEP 1/5: FROM arm32v7/rust:1.63.0 AS builder
WARNING: image platform ({arm linux [] v7}) does not match the expected platform ({amd64 linux [] })
[1/2] STEP 2/5: RUN apt update && apt upgrade -y
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
unqualified-search-registries = ["docker.io"]
❯ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
Setting /usr/bin/qemu-alpha-static as binfmt interpreter for alpha
Setting /usr/bin/qemu-arm-static as binfmt interpreter for arm
Setting /usr/bin/qemu-armeb-static as binfmt interpreter for armeb
Setting /usr/bin/qemu-sparc-static as binfmt interpreter for sparc
Setting /usr/bin/qemu-sparc32plus-static as binfmt interpreter for sparc32plus
Setting /usr/bin/qemu-sparc64-static as binfmt interpreter for sparc64
Setting /usr/bin/qemu-ppc-static as binfmt interpreter for ppc
Setting /usr/bin/qemu-ppc64-static as binfmt interpreter for ppc64
Setting /usr/bin/qemu-ppc64le-static as binfmt interpreter for ppc64le
## builder
FROM arm32v7/rust:1.63.0 as builder
RUN apt update && apt upgrade -y
WORKDIR /usr/src/app
COPY . .
RUN cargo build --release
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: rcv-deployment
labels:
name: rcv
spec:
replicas: 3
selector:
❯ kubectl apply -f manifests/
deployment.apps/rcv-deployment created
ingress.networking.k8s.io/rcv-ingress created
service/rcv created
❯ kubectl get pods
NAME READY STATUS RESTARTS AGE
rcv-deployment-55588c6f68-5gshl 1/1 Running 0 7s
rcv-deployment-55588c6f68-d7r84 1/1 Running 0 7s
rcv-deployment-55588c6f68-zw27j 1/1 Running 0 7s
❯ kubectl delete -f manifests
deployment.apps "rcv-deployment" deleted
ingress.networking.k8s.io "rcv-ingress" deleted
service "rcv" deleted
❯ docker build . -f Dockerfile.armv7
Sending build context to Docker daemon 894.2MB
Step 1/14 : FROM rust:1.63.0 as builder
---> 2a7d3c69bbf0
Step 2/14 : RUN apt update && apt upgrade -y
---> Using cache
---> 3a3120a0cb99
Step 3/14 : RUN apt install -y g++-arm-linux-gnueabihf libc6-dev-armhf-cross
---> Using cache
---> 78e25363f688
## builder
FROM rust:1.63.0 as builder
RUN apt update && apt upgrade -y
RUN apt install -y g++-arm-linux-gnueabihf libc6-dev-armhf-cross
RUN rustup target add armv7-unknown-linux-gnueabihf
RUN rustup toolchain install stable-armv7-unknown-linux-gnueabihf
WORKDIR /usr/src/app