Skip to content

Build fails when using Dockerfile.template (missing curl & unexpected end of file) #643

@fellwell5

Description

@fellwell5

Hello!

When using the provided Dockerfile.template, I am running into issues while building the image.

1. Missing curl

curl is not installed in the base image, so I added it to the apt-get install command.

2. Build error: gzip: stdin: unexpected end of file

After adding curl, the image build fails with the following error:

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now

Dockerfile (hidden in spoiler)

Click to expand Dockerfile
FROM debian:bullseye

RUN apt-get update && apt-get install -y --no-install-recommends dnsmasq wireless-tools curl

# use latest version. If specific version is required, it should be provided as vX.Y.Z, e.g v4.11.37
ARG VERSION="latest"

# create /usr/src/app/ui directory where we will extract pre-built UI 
WORKDIR /usr/src/app/ui

WORKDIR /usr/src/app

RUN \
    export BASE_URL="https://github.com/balena-os/wifi-connect/releases" &&\    
    DETECTED_ARCH=$(uname -m) &&\
    case $DETECTED_ARCH in \
    "aarch64") \
    BINARY_ARCH_NAME="aarch64-unknown-linux-gnu" ;; \
    "x86_64") \
    BINARY_ARCH_NAME="x86_64-unknown-linux-gnu" ;;\
    "armv7l") \
    BINARY_ARCH_NAME="armv7-unknown-linux-gnueabihf" ;;\
    *) \
    echo >&2 "error: unsupported architecture ($DETECTED_ARCH)"; exit 1 ;; \ 
    esac;\
    if [ ${VERSION} = "latest" ]; then \
    export URL_PARTIAL="latest/download" ; \
    else \
    export URL_PARTIAL="download/${VERSION}" ; \
    fi; \
    curl -Ls "$BASE_URL/$URL_PARTIAL/wifi-connect-$BINARY_ARCH_NAME.tar.gz" \
    | tar -xvz -C  /usr/src/app/ &&\
    curl -Ls "$BASE_URL/$URL_PARTIAL/wifi-connect-ui.tar.gz" \
    | tar -xvz -C  /usr/src/app/ui 

COPY scripts/start.sh .

CMD ["bash", "start.sh"]

Question

Does anyone know how to resolve this error?
It seems like the downloaded archive may be corrupted or unavailable for the detected architecture, but I am unsure how to fix it.

Best regards,
Matthias

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions