Open otomay opened 2 weeks ago
Hi @otomay thanks for opening the issue, yep we can make this support arm, to your question, you can mount the same volume in multiple containers, that how it is done in the example, and it would work if you do ro in one place and rw in another
Thank you! I tried to contribute by forking, but got stuck. I edited the Dockerfile to adjust the cargo build to identify the arch, but I got rust errors when running and I know nothing about rust :/
IDK if help, but I'll share what have I done:
ARG LAZYMC_VERSION=0.2.11
ARG LAZYMC_LEGACY_VERSION=0.2.10
FROM busybox:1.37.0-uclibc as downloader
ARG TARGETARCH
ARG LAZYMC_VERSION
ENV LAZYMC_VERSION=$LAZYMC_VERSION
RUN if [ "$TARGETARCH" = "amd64" ]; then \
wget https://github.com/timvisee/lazymc/releases/download/v${LAZYMC_VERSION}/lazymc-v${LAZYMC_VERSION}-linux-x64 -O /lazymc; \
elif [ "$TARGETARCH" = "arm64" ]; then \
wget https://github.com/timvisee/lazymc/releases/download/v${LAZYMC_VERSION}/lazymc-v${LAZYMC_VERSION}-linux-aarch64 -O /lazymc; \
elif [ "$TARGETARCH" = "armv7" ]; then \
wget https://github.com/timvisee/lazymc/releases/download/v${LAZYMC_VERSION}/lazymc-v${LAZYMC_VERSION}-linux-armv7 -O /lazymc; \
fi
RUN chmod +x /lazymc
ARG LAZYMC_LEGACY_VERSION
ENV LAZYMC_LEGACY_VERSION=$LAZYMC_LEGACY_VERSION
RUN if [ "$TARGETARCH" = "amd64" ]; then \
wget https://github.com/timvisee/lazymc/releases/download/v${LAZYMC_LEGACY_VERSION}/lazymc-v${LAZYMC_LEGACY_VERSION}-linux-x64 -O /lazymc-legacy; \
elif [ "$TARGETARCH" = "arm64" ]; then \
wget https://github.com/timvisee/lazymc/releases/download/v${LAZYMC_LEGACY_VERSION}/lazymc-v${LAZYMC_LEGACY_VERSION}-linux-aarch64 -O /lazymc-legacy; \
elif [ "$TARGETARCH" = "armv7" ]; then \
wget https://github.com/timvisee/lazymc/releases/download/v${LAZYMC_LEGACY_VERSION}/lazymc-v${LAZYMC_LEGACY_VERSION}-linux-armv7 -O /lazymc-legacy; \
fi
RUN chmod +x /lazymc-legacy
# build this app
FROM rust:1.81 as app-builder
RUN rustup target add x86_64-unknown-linux-musl aarch64-unknown-linux-musl
RUN apt update && apt install -y musl-tools musl-dev
RUN update-ca-certificates
RUN apt-get update && apt-get install -y pkg-config libssl-dev
WORKDIR /usr/src/lazymc-docker-proxy
COPY Cargo.toml Cargo.lock ./
COPY src ./src
ARG TARGETARCH
RUN if [ "$TARGETARCH" = "amd64" ]; then \
cargo build --target x86_64-unknown-linux-musl --release --locked; \
elif [ "$TARGETARCH" = "arm64" ]; then \
cargo build --target aarch64-unknown-linux-musl --release --locked; \
fi
FROM busybox:1.37.0-uclibc as health-init
RUN mkdir -p /app && echo "STARTING" > /app/health
FROM busybox:1.37.0-uclibc
ARG TARGETARCH
ARG LAZYMC_VERSION
ENV LAZYMC_VERSION=$LAZYMC_VERSION
ARG LAZYMC_LEGACY_VERSION
ENV LAZYMC_LEGACY_VERSION=$LAZYMC_LEGACY_VERSION
COPY --from=downloader /lazymc /usr/local/bin/lazymc
COPY --from=downloader /lazymc-legacy /usr/local/bin/lazymc-legacy
COPY --from=app-builder /usr/src/lazymc-docker-proxy/target/${TARGETARCH/arm64/aarch64}-unknown-linux-musl/release/lazymc-docker-proxy /usr/local/bin/lazymc-docker-proxy
COPY --from=health-init /app/health /app/health
WORKDIR /app
HEALTHCHECK --start-period=1m --interval=5s --retries=24 CMD ["lazymc", "--health"]
ENTRYPOINT ["lazymc-docker-proxy"]
I just downloaded the pre-build binaries instead of building like you to speed things up on my testings. But maybe it can be worth to use like that? idk
and the the logs from lazymc container (where I got stucked):
INFO lazymc-docker-proxy::entrypoint > Ensuring all server containers are stopped...
INFO lazymc-docker-proxy::entrypoint > Starting lazymc process for group: mc...
thread 'main' panicked at src/entrypoint/mod.rs:35:14:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Hey! Could you support arm64 in the pre-built images, please?
running with latest build:
exec /usr/local/bin/lazymc-docker-proxy: exec format error
I builded locally on my arm64 device, but it didn't work, probably because of the cargo build targeting x86_64.
and my question:
can I just point to the same volume /data of "mc" service? or should I point to specific server folder?
thanks!