I'm attempting to deploy a .net Application to Digital Ocean Kubernetes, put to no luck. When creating a simple web.yml deployment I am seeing the status log return ERROR
and when running logs on the pod I see the following:
standard_init_linux.go:228: exec user process caused: exec format error
I have done some research around this error, and it seems that my architecture is mismatched. However, I'm 99.999% my architecture my Digital Ocean cluster is AMD, and the image I have built from the following Dockerfile is linux/arm64/v8.
I have the following Dockerfile:
# syntax=docker/dockerfile:1
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /app
# copy everything else and build app
COPY . .
RUN dotnet restore
WORKDIR /app/ASCOM.Alpaca.Simulators
RUN dotnet publish -c Release -o out
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime
WORKDIR /app
COPY --from=build /app/ASCOM.Alpaca.Simulators/out ./
Which I build and push to my docker hub via the standard docker compose build
command.
I've looked a few few online references around how to potentially build this as AMD, or other, but I currently can't seem to reference a working potential solution.
I have the following docker-compose.yaml file:
version: "3.9"
services:
web:
build: .
ports:
- "80:32323"
image: observerly/ascom-alpaca:latest
command: ["dotnet", "ascom.alpaca.simulators.dll", "--urls=http://*:32323"]
I have seen topics around buildkit ... but I haven't really been able to understand the exact steps I need to take to build a different arch image for .net core.
I've run docker manifest inspect --verbose mcr.microsoft.com/dotnet/aspnet:6.0
which gives me the hint that AMD64 can be used:
"platform": {
"architecture": "amd64",
"os": "linux"
}
Any pro-tips would be amazing!