Docker & Containers

Expose containerized applications.

Expose Container by IP

Find container IP:

bash
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name

Expose the container:

bash
drip http 8080 -a 172.17.0.3

Expose Container by Name

If using Docker's DNS (custom network):

bash
drip http 3000 -a my-app-container

Database Access for Debugging

Expose PostgreSQL:

bash
drip tcp 5432 -a postgres-container --allow-ip YOUR_IP

Expose MySQL:

bash
drip tcp 3306 -a mysql-container --allow-ip YOUR_IP

Expose Redis:

bash
drip tcp 6379 -a redis-container --allow-ip YOUR_IP

Expose MongoDB:

bash
drip tcp 27017 -a mongo-container --allow-ip YOUR_IP

Docker Compose Integration

Add Drip to your docker-compose.yml:

yaml
services:
  app:
    image: my-app
    ports:
      - "3000:3000"

  tunnel:
    image: alpine
    command: >
      sh -c "apk add curl bash &&
             bash <(curl -sL https://driptunnel.app/install.sh) --client &&
             drip http 3000 -a app -s tunnel.example.com:443 -t YOUR_TOKEN"
    depends_on:
      - app

Using Host Network Mode

If your container uses host network:

bash
drip http 3000  # Just use localhost

Docker Bridge Network

For containers on the default bridge network:

bash
# Get container IP
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mycontainer

# Expose it
drip http 8080 -a 172.17.0.2

Custom Docker Network

For containers on a custom network:

bash
# Create network
docker network create mynet

# Run container
docker run --network mynet --name myapp myimage

# From another container on same network, use container name
drip http 8080 -a myapp

Kubernetes Services

Expose a Kubernetes service locally:

bash
kubectl port-forward svc/my-service 8080:80 &
drip http 8080 -n k8s-service

Expose a pod directly:

bash
kubectl port-forward pod/my-pod 3000:3000 &
drip http 3000 -n k8s-pod

Podman Containers

Drip works the same way with Podman:

bash
podman inspect -f '{{.NetworkSettings.IPAddress}}' container_name
drip http 8080 -a 10.88.0.2