Terraform apt install is taking the latest even after specifying the version

we have a docker file from where we are installing the terraform

curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - &&
apt-add-repository “deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main” &&
apt-get update && apt-get install terraform=1.0.11 && apt-get install terraform packer=1.7.8 && \

every time we are trying to build the image it is installing the latest version with this output.

After this operation, 152 MB of additional disk space will be used. Get:1 https://apt.releases.hashicorp.com bullseye/main amd64 packer amd64 1.7.8 [31.8 MB] Get:2 https://apt.releases.hashicorp.com bullseye/main amd64 terraform amd64 1.1.0 [18.7 MB] e[91mdebconf: delaying package configuration, since apt-utils is not installed e[0mFetched 50.5 MB in 1s (89.8 MB/s) Selecting previously unselected package packer. (Reading database … (Reading database … 5% (Reading database … 10% (Reading database … 15% (Reading database … 20% (Reading database … 25% (Reading database … 30% (Reading database … 35% (Reading database … 40% (Reading database … 45% (Reading database … 50% (Reading database … 55% (Reading database … 60% (Reading database … 65% (Reading database … 70% (Reading database … 75% (Reading database … 80% (Reading database … 85% (Reading database … 90% (Reading database … 95% (Reading database … 100% (Reading database … 27108 files and directories currently installed.) Preparing to unpack …/packer_1.7.8_amd64.deb … Unpacking packer (1.7.8) … Preparing to unpack …/terraform_1.1.0_amd64.deb … Unpacking terraform (1.1.0) over (1.0.11) … Setting up packer (1.7.8) … Setting up terraform (1.1.0) …