Downloaded tar.gz to /daml/sdk, extracted it, ran install.sh it printed to add /daml/bin to path which I did. daml version prints fine. daml build gets the error. daml build is being run from the project directory.
If you’re talking Docker images, I’d recommend going for something along the lines of this:
FROM ubuntu:kinetic
RUN apt-get update \
&& apt-get install -y curl openjdk-11-jre-headless \
&& rm -rf /var/lib/apt/lists/*
ARG VERSION
# This is needed to get the DNS requests
# from Haskell binaries to succeed.
# Otherwise they fail to even resolve localhost.
RUN echo 'hosts: files dns' > /etc/nsswitch.conf
RUN addgroup --system daml && adduser --system --ingroup daml daml
USER daml
RUN curl https://get.daml.com | sh -s $VERSION \
&& printf "auto-install: false\nupdate-check: never\n" >> /home/daml/.daml/daml-config.yaml
ENV PATH="/home/daml/.daml/bin:${PATH}"
WORKDIR /home/daml
TEMP=$(mktemp -d)
cd $TEMP
wget https://github.com/digital-asset/daml/releases/download/v2.4.0/daml-sdk-2.4.0-linux.tar.gz
tar xzf daml-sdk-2.4.0-linux.tar.gz
sdk-2.4.0/install.sh
export PATH=$HOME/.daml/bin:$PATH
cd $(mktemp -d)
rm -rf $TEMP
daml new t
cd t
daml build