Hi I was facing same issue and searching for the solution but didnt get it, and now after working on it i have the solution 🙂
if you want to access databricks models/download_artifacts using hostname and access token like how you do on databricks cli
databricks configure --token --profile <profile name>
>Databricks Host (should begin with https://): <hostname>
>Token : <token>
if you have created profile name and pushed models and just want to access the model/artifacts in docker using this profile
Add below code in the docker file.
RUN pip install databricks_cli
ARG HOST_URL
ARG TOKEN
RUN echo "[<profile name>]\nhost = ${HOST_URL}\ntoken = ${TOKEN}" >> ~/.databrickscfg
#this will created your .databrickscfg file with host and token after build the same way you do using databricks configure command
Add args HOST_URL and TOKEN in the docker build
e.g
your host name = https://adb-5443106279769864.19.azuredatabricks.net/
your access token = dapi********************63c1-2
sudo docker build -t test_tag --build-arg HOST_URL=<your host name> --build-arg TOKEN=<your access token> .
And now you can access your experiments using this profilename Databricks:<profile name> in the code.