the `0.33.8` release the `comics-downloader` binary may be in the wrong format (arm64).
Closed this issue · 3 comments
bashfulrobot commented
Describe the bug
A clear and concise description of what the bug is.
Seems like in the 0.33.8
release the comics-downloader
binary may be in the wrong format. It seems to be arm vs amd.
To Reproduce
Steps to reproduce the behavior:
❯ wget https://github.com/Girbons/comics-downloader/releases/download/v0.33.
8/comics-downloader
❯ ls
0644 .rw-r--r-- 11M dustin 5 Jan 07:17 comics-downloader
0644 .rw-r--r-- 410 dustin 11 Feb 11:04 Dockerfile
❯ file comics-downloader
comics-downloader: ELF executable, 64-bit LSB arm64, static, not stripped
Expected behavior
A clear and concise description of what you expected to happen.
I would expect the file
command the reflect x64.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: Linux (NixOS)
- Version 23.11
- Type Gui - Gnome
bashfulrobot commented
As a further test to rule out my nixos system, I quickly put together a docker container.
# Use the latest version of Ubuntu
FROM ubuntu:latest
# Update the system and install necessary packages
RUN apt-get update && apt-get install -y \
wget
# Download the latest version of comics-downloader
RUN wget https://github.com/Girbons/comics-downloader/releases/download/v0.33.8/comics-downloader
# Make the binary executable
RUN chmod +x comics-downloader
# Create the /app directory
RUN mkdir /app
RUN mkdir /app/mount
# Move the binary to the /app directory
RUN mv comics-downloader /app
# Set the working directory
WORKDIR /app
Then I run it with:
docker run -it -v "$(pwd):/app/mount" {{image}} /bin/bash
And get:
root@ec7044cfdaca:/app# ./comics-downloader --help
bash: ./comics-downloader: cannot execute binary file: Exec format error
bashfulrobot commented
And this dockerfile will work.
# First stage: Build the application
FROM golang:1.22 as builder
WORKDIR /src
# Install unzip and wget
RUN apt-get update && apt-get install -y \
wget \
unzip
# Download the source code
RUN wget https://github.com/Girbons/comics-downloader/archive/refs/tags/v0.33.8.zip
# Unzip the source code
RUN unzip v0.33.8.zip && rm v0.33.8.zip
# Move to the source code directory
WORKDIR /src/comics-downloader-0.33.8
# Build the application
RUN GOOS=linux go build -o /app/comics-downloader ./cmd/downloader
# Second stage: Create the final image
FROM ubuntu:latest
RUN mkdir /app && mkdir /app/mount
WORKDIR /app
# Copy the binary from the builder stage
COPY --from=builder /app/comics-downloader /app
# Make the binary executable
RUN chmod +x /app/comics-downloader
bashfulrobot commented
Seems to be fixed in the alpha release.