In this post, I will explain how to access to Docker container shell that hosted on Synology NAS using “Terminal” on MacOS.
Assuming you know how to create and start a Docker Container on Synology NAS. I will write a post in the future explaining the steps to create and run Docker Container on Synology NAS (Network-Attached Storage).
The first step is to ssh into Synology NAS on Terminal :
ssh <Username>@<SynologyNAS-IP-Addess> -p22
For example:
ssh User1@192.168.9.108 -p22
Next, issue the following command to check any running docker processes.
docker ps
Then, use “docker exec command” to access shell to the container using interactive mode (“–it” option):
docker exec -it <container-name> <command> or <shell path>
For this example, <container-name> is “python-1” and bash <shell path> is “/bin/bash”:
docker exec -it python-1 /bin/bash
The bash prompt is now accessible via Terminal.
Finally, I can activate my TensorFlow python virtual environment. This python virtual environment is for machine learning experiments/projects. It’s hosted on Synology NAS, and I can access it just like on local machine as command below:
source /tensorflow/bin/active
Please leave me a comment if you have any questions. Thanks.