Skip to content

Commit

Permalink
detect host architecture
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Baker <[email protected]>
  • Loading branch information
EmbeddedAndroid committed Nov 5, 2024
1 parent 6346db0 commit db044ae
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ FROM ubuntu:20.04 AS container-tools
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y wget git make \
libgpgme-dev libassuan-dev libbtrfs-dev libdevmapper-dev pkg-config
libgpgme-dev libassuan-dev libbtrfs-dev libdevmapper-dev pkg-config \
file

# Detect host architecture
RUN file /bin/bash | grep -q x86-64 && echo amd64 > /tmp/arch || true
RUN file /bin/bash | grep -q aarch64 && echo arm64 > /tmp/arch || true

RUN wget -P /tmp https://go.dev/dl/go1.18.linux-amd64.tar.gz && \
tar -C /usr/local -xzf /tmp/go1.18.linux-amd64.tar.gz
Expand All @@ -17,7 +22,12 @@ RUN git clone https://github.com/containers/skopeo.git /skopeo && \
# Build ostreeuploader, aka fiopush/fiocheck
FROM ubuntu:20.04 AS fiotools
RUN apt-get update
RUN apt-get install -y wget git gcc make
RUN apt-get install -y wget git gcc make file

# Detect host architecture
RUN file /bin/bash | grep -q x86-64 && echo amd64 > /tmp/arch || true
RUN file /bin/bash | grep -q aarch64 && echo arm64 > /tmp/arch || true

RUN wget -P /tmp https://go.dev/dl/go1.19.9.linux-amd64.tar.gz && \
tar -C /usr/local -xzf /tmp/go1.19.9.linux-amd64.tar.gz
ENV PATH /usr/local/go/bin:$PATH
Expand Down

0 comments on commit db044ae

Please sign in to comment.