Environment Variable is not set

Hi,
I’m new to docker. For my project, I have created the following Dockerfile:

FROM ubuntu:latest

ENV DEBIAN_FRONTEND noninteractive
ENV JACK_NO_AUDIO_RESERVATION 1

RUN apt-get update
RUN apt-get install -y apt-utils
RUN apt-get install -y git
RUN apt-get install -y curl zip unzip tar
RUN apt-get install -y zip
RUN apt-get install -y unzip
RUN apt-get install -y tar
RUN apt-get install -y build-essential
RUN apt-get install -y pkg-config
RUN apt-get install -y python3
RUN apt-get install -y libssl-dev
RUN apt-get install -y ruby-dev
RUN apt-get install -y elixir
RUN apt-get install -y erlang-dev
RUN apt-get install -y erlang-xmerl
RUN apt-get install -y qttools5-dev
RUN apt-get install -y qttools5-dev-tools
RUN apt-get install -y libqt5svg5-dev
RUN apt-get install -y libqt5opengl5-dev
RUN apt-get install -y supercollider-server
RUN apt-get install -y sc3-plugins-server
RUN apt-get install -y alsa-utils
RUN apt-get install -y jackd2
RUN apt-get install -y libjack-jackd2-dev
RUN apt-get install -y libjack-jackd2-0
RUN apt-get install -y libasound2-dev
RUN apt-get install -y pulseaudio-module-jack
RUN apt-get install -y cmake
RUN apt-get install -y ninja-build

RUN groupadd -g 1000 sancho
RUN useradd -d /home/sancho -s /bin/bash -m sancho -u 1000 -g 1000
USER sancho
ENV HOME /home/sancho

WORKDIR $HOME/
RUN git clone https://github.com/sonic-pi-net/sonic-pi.git
RUN cd sonic-pi/app && ./linux-build-all.sh

CMD ["/bin/bash"]

When I’m done I do want to use user sancho in the container, but while I still have to manually install software and do other stuff as root user after building the image and creating the container, I am creating the container with command:

docker create -it --user root --device /dev/snd --group-add $(getent group audio | cut -d: -f3) -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -h $HOSTNAME -v $HOME/.Xauthority:/home/sancho/.Xauthority sonic_pi

As you see in my Dockerfile, I am setting environment variable JACK_NO_AUDIO_RESERVATION. But when I start the container, this variable is not set, echo $JACK_NO_AUDIO_RESERVATION gives nothing.

Any ideas?

Thanks,
Martin

The documentation uses ENV=VALUE. Seems like you just declared two keys without values.
Try env | sort in the container terminal to see whether the keys indeed are created, but have no value.

See: Dockerfile reference | Docker Documentation