Closed Marmelatze closed 2 weeks ago
@coffeegoddd or @reltuk will look at this
Thanks for reporting this one. @coffeegoddd and I were just poking around and didn't see any obvious problems in the docker build scripts, but we'll keep digging in to find what's happening here.
I think the problem is that BUILDARCH
is the archtiecture of the build host an not of the target. TARGETARCH
would be the right variable according to the docs: https://docs.docker.com/build/building/variables/#multi-platform-build-arguments
@Marmelatze Thanks for submitting this issue!
I did some investigation into our DockerHub image release process and from what I can tell, it is pretty broken for arm64. I don't think it has ever worked, actually.
We attempt to use the docker/build-push-action
action to build dolthub/dolt
and dolthub/dolt-sql-server
on multiple platforms, but the Dockerfile definitions aren't quiet right for doing this...
As you've pointed out, even the BUILDARCH
variable isn't quiet right. I'm planning to fix this and get this working properly, but it will take a bit of finagling, and I'll be out of the office until next week.
In the meantime I've included some Dockerfile definitions you can use to successfully create arm64 images, so that you aren't blocked, until my fix is in:
For a dolthub/dolt
arm64 image for Dolt v1.41.3 you can use:
FROM --platform=linux/arm64 ubuntu:22.04
ENV DOLT_VERSION=1.41.3
RUN apt update -y && \
apt install -y \
tini \
ca-certificates && \
apt clean && \
rm -rf /var/lib/apt/lists/*
ADD https://github.com/dolthub/dolt/releases/download/v${DOLT_VERSION}/dolt-linux-arm64.tar.gz dolt-linux-arm64.tar.gz
RUN tar zxvf dolt-linux-arm64.tar.gz && \
cp dolt-linux-arm64/bin/dolt /usr/local/bin && \
rm -rf dolt-linux-arm64 dolt-linux-arm64.tar.gz
WORKDIR /var/lib/dolt
ENTRYPOINT ["tini", "--", "/usr/local/bin/dolt"]
You can build this image with docker build -t dolt:v1.41.3 -f Dockerfile .
, and then run it with docker run dolt:v1.41.3
.
For a dolthub/dolt-sql-server
arm64 image for Dolt v1.41.3 you can use:
FROM --platform=linux/arm64 ubuntu:22.04
ENV DOLT_VERSION=1.41.3
RUN apt update -y && \
apt install -y \
tini \
ca-certificates && \
apt clean && \
rm -rf /var/lib/apt/lists/*
ADD https://github.com/dolthub/dolt/releases/download/v${DOLT_VERSION}/dolt-linux-arm64.tar.gz dolt-linux-arm64.tar.gz
RUN tar zxvf dolt-linux-arm64.tar.gz && \
cp dolt-linux-arm64/bin/dolt /usr/local/bin && \
rm -rf dolt-linux-arm64 dolt-linux-arm64.tar.gz
RUN mkdir /docker-entrypoint-initdb.d
VOLUME /var/lib/dolt
COPY ./docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
EXPOSE 3306 33060
WORKDIR /var/lib/dolt
ENTRYPOINT ["tini", "--", "docker-entrypoint.sh"]
You can build this image with docker build -t dolt-sql-server:v1.41.3 -f Dockerfile .
, and then run it with docker run dolt-sql-server:v1.41.3
. Note you will need a copy of docker-entrypoint.sh next to the Dockerfile for this to build successfully, since it contains a COPY
statement.
@Marmelatze Actually, I had some time to fix this before my vacation. Docker images are fixed for Dolt >= 1.41.4.
% docker create --platform=linux/arm64 dolthub/dolt:1.41.4
Unable to find image 'dolthub/dolt:1.41.4' locally
1.41.4: Pulling from dolthub/dolt
4ce000a43472: Already exists
a4c27a1e8138: Pull complete
558316364871: Pull complete
d7c8812eaf64: Pull complete
c723a631958f: Pull complete
Digest: sha256:709b88ddf77e602c129f363ee068190fcf56fc8b7aefac62445a03ea12e1fb4d
Status: Downloaded newer image for dolthub/dolt:1.41.4
cbe0802d7029c66fe449ca644f597da06aa73816c1d40e22c6ad0e88e8d947a0
% docker cp cbe0802d7029c66fe449ca644f597da06aa73816c1d40e22c6ad0e88e8d947a0:/usr/local/bin/dolt .
Successfully copied 97.1MB to /Users/dustin/src/ld/.
% file ./dolt
./dolt: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=zV3iJYE8d8fGl_tL2v_q/Au58OCAEMA4OPTqEFp1_/i6mx-B9qwkygMc9t-zuW/ZyG9Kl0IHoYjmejp0SbO, stripped
% rm ./dolt
% docker create --platform=linux/amd64 dolthub/dolt:1.41.4
Unable to find image 'dolthub/dolt:1.41.4' locally
1.41.4: Pulling from dolthub/dolt
3713021b0277: Already exists
981eb1c518ed: Pull complete
171c492a2a4e: Pull complete
2914ef3228d2: Pull complete
75f8143a59cb: Pull complete
Digest: sha256:709b88ddf77e602c129f363ee068190fcf56fc8b7aefac62445a03ea12e1fb4d
Status: Downloaded newer image for dolthub/dolt:1.41.4
d5fcc161b1d80dd6e9dc9f0720b6fb2f0c8b07fa902c6a7e87f1142105582e16
% docker cp d5fcc161b1d80dd6e9dc9f0720b6fb2f0c8b07fa902c6a7e87f1142105582e16:/usr/local/bin/dolt .
Successfully copied 100MB to /Users/dustin/src/ld/.
% file ./dolt
./dolt: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=GYoOvPaBuN3_SwKCe-AL/hRp6IvzeTbOEmHerStHC/y1PabwQ99qV2y3G6sSlX/7DEEYi2-H4RbYfgbXgmd, stripped
It looks like the docker image for arm64 on dockerhub does not contain the right binaries. Therfore it cannot be run on arm machines: