Hello, I am trying to build a Docker image based off of retype.
In this documentation, there is an example of a Dockerfile
that will build a Docker image that can then be deployed on cloud providers.
However, I am on an arm64
machine which means that when I build it, the Docker image is ARM64
. I am trying to deploy this on DigitalOcean through App Service but get the error:
[2025-02-12 18:17:16] starting container: starting sub-container [httpd-foreground]: creating process: failed to load /usr/local/bin/httpd-foreground: exec format error
I believe this is because the format is not correct and I need an amd64
image. However, when I try to build it with: docker build --platform=linux/amd64 -t retype:docs .
- the build is taking way too long:
Here is the Dockerile:
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS builder
WORKDIR /build
# Pre-install dependencies first to leverage Docker's build cache
RUN dotnet nuget locals all --clear
RUN dotnet tool install retypeapp --tool-path /bin
COPY . /build
RUN retype build --output .docker-build/
FROM httpd:latest
COPY --from=builder /build/.docker-build/ /usr/local/apache2/htdocs/