A Docker container port forwarding service for Parallels
Project description
Parallels Docker Port Forwarding
Parallels Docker Port Forwarding is a service that automatically manages port forwarding for Docker containers running inside a Parallels VM.
Features
- Automatically detects running Docker containers and their exposed ports.
- Sets up port forwarding rules from the host to the Parallels VM.
- Monitors Docker events and updates port forwarding rules dynamically.
Requirements
- Python 3.8+
- Poetry
- Docker SDK for Python
- Parallels Desktop with
prlctlandprlsrvctlcommand-line tools - Docker configured to accept TCP connections on the VM
Setting up Docker to accept TCP connections on the VM
-
Edit the Docker service configuration file:
Open the Docker service configuration file in your VM. This is usually located at
/lib/systemd/system/docker.service.sudo nano /lib/systemd/system/docker.service
-
Modify the
ExecStartline:Find the line that starts with
ExecStartand modify it to include the-H tcp://0.0.0.0:2375option. It should look something like this:ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375
-
Reload the systemd configuration and restart Docker:
sudo systemctl daemon-reload sudo systemctl restart docker
-
Verify that Docker is listening on TCP port 2375:
sudo netstat -tlpn | grep dockerd
Installation
You can install the package using pip:
pip install parallels-docker-port-forwarding
Usage
To start the port forwarding service, run:
parallels-docker-port-forwarding --vm-name "Your VM Name"
If the VM name is not provided, the default VM name 'Ubuntu 22.04.2 (x86_64 emulation)' will be used.
Development
To set up the development environment:
- Clone the repository:
git clone https://github.com/imtpot/parallels-docker-port-forwarding.git
cd parallels-docker-port-forwarding
- Install dependencies using Poetry:
poetry install
- Run the service:
poetry run parallels-docker-port-forwarding --vm-name "Your VM Name"
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file parallels_docker_port_forwarding-0.1.3.tar.gz.
File metadata
- Download URL: parallels_docker_port_forwarding-0.1.3.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.19 Darwin/23.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a59b712873406814362972e11b141a5788b7bb8f1cbe6a9e1005f25a40045379
|
|
| MD5 |
ee8bae5934dcc4fcb9dc048e493b8504
|
|
| BLAKE2b-256 |
06a80d0f46059d106b208016a5f1340bd1f433771284bc4b401f0209551fb214
|
File details
Details for the file parallels_docker_port_forwarding-0.1.3-py3-none-any.whl.
File metadata
- Download URL: parallels_docker_port_forwarding-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.19 Darwin/23.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3986e10a4cfd4280a44815c2f0bd1d975319449c4c76719be232aeaa077b6c67
|
|
| MD5 |
47eb22cece9a8b823804c853041794fb
|
|
| BLAKE2b-256 |
d6b62f388dc7d7a3b69f389df03415c145e2735c1b103ae008581539305c2367
|