Dockerfile entrypoint binary set to aenv variable

I have a builder script to create docker image.

In that builder script i have passed on the binary name to Dockerfile as build-args.

However when i use it in entrypoint as : Entrypoint[“./”${pkg}].

Though it does resolve pkg docker container fails to run stating ./rtspappserver not found.

Here rtspappserver is pkg name.

The build args I sent from script was set as an ENV var in dockerfile.

Below is Dockerfile for reference:

> #Download base image ubuntu 18.04 FROM ubuntu:18.04 ARG package_name ENV TZ=Etc/UTC ENV pkg=$package_name RUN ln -snf
> /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
> # Update and dist-upgrade ubuntu RUN apt update -y &&   apt dist-upgrade -y &&   apt install -y python-heatclient WORKDIR / COPY
> ${pkg} / ENTRYPOINT ["./rtspappserver"]

Please help.
Any pointer would be much appreciated.

Source: StackOverflow