Learn to run the Telepresence daemon in a Docker container without modifying the host’s network configuration or requiring admin privileges.
In this guide, you’ll learn how to run the Telepresence daemon inside a Docker container. This method avoids modifications to the host’s network configuration and does not require admin privileges.
docker ps# CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS# 469b3f77cdcb ghcr.io/telepresenceio/telepresence:2.20.0 "telepresence connec…" 18 seconds ago Up 17 seconds 127.0.0.1:42715->42715/tcp tp-arn_aws_eks_us-east-1_195725640053_cluster_telepresence-default-cn
kubectl get svc# NAME TYPE CLUSTER-IP PORT(S) AGE# auth-service ClusterIP 10.100.10.52 3000/TCP 4h57m# inventory-service ClusterIP 10.100.246.69 3000/TCP 5h34mcurl http://auth-service:3000# {"message":"this is the auth service"}
const express = require("express");const app = express();const port = 8000;app.get("/", (req, res) => { res.json({ message: "this is the auth service running on my machine" });});app.listen(port, () => { console.log(`Example app listening on port ${port}`);});
kubectl get svc products-servicecurl http://a2517fc7ee41999dd7c47eed9f866-376507947.us-east-1.elb.amazonaws.com:3000/?product_ids=1,2,3# {"data":[...],"message":"running on container on local machine"}
telepresence intercept products-depl \ --port 8000 \ --docker-run -- \ -v $(pwd):/usr/src/app my-test-image npm run dev# [nodemon] 3.1.7# [nodemon] to restart at any time, enter `rs`# [nodemon] starting `node index.js`# Example app listening on port 8000
Any change in the products directory now triggers an auto-reload inside the container.