Skip to content

Commit

Permalink
Fix Dockerfile.template
Browse files Browse the repository at this point in the history
Signed-off-by: Rahul Thakoor <rahul@balena.io>
  • Loading branch information
rahul-thakoor committed Apr 24, 2024
1 parent f4c09b3 commit d02fb7f
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Dockerfile.template
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
ARG BALENA_ARCH=%%BALENA_ARCH%%

FROM balenalib/$BALENA_ARCH-debian
ARG BALENA_ARCH=%%BALENA_ARCH%%


RUN install_packages dnsmasq wireless-tools

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

WORKDIR /usr/src/app

RUN \
export BASE_URL="https://github.com/balena-os/wifi-connect/releases" &&\
case $BALENA_ARCH in \
"rpi") \
BINARY_ARCH_NAME="arm-unknown-linux-gnueabihf" ;; \
"aarch64") \
BINARY_ARCH_NAME="aarch64-unknown-linux-gnu" ;; \
"amd64") \
BINARY_ARCH_NAME="x86_64-unknown-linux-gnu.tar.gz" ;;\
BINARY_ARCH_NAME="x86_64-unknown-linux-gnu" ;;\
"armv7hf") \
BINARY_ARCH_NAME="armv7-unknown-linux-gnueabihf.tar.gz" ;;\
BINARY_ARCH_NAME="armv7-unknown-linux-gnueabihf" ;;\
*) \
echo >&2 "error: unsupported architecture ($BALENA_ARCH)"; exit 1 ;; \
esac &&\
curl -Ls "https://github.com/balena-os/wifi-connect/releases/download/${VERSION}/wifi-connect-$BINARY_ARCH_NAME.tar.gz" \
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/

COPY scripts/start.sh .
Expand Down

0 comments on commit d02fb7f

Please sign in to comment.