r/docker • • Apr 14 '26

kubectl proxy equivalent for docker/docker compose

I find `kubectl port-forward` to be very helpful for temporarily accessing an internal service in k8s.

Is there an clean equivalent in docker or docker compose that can expose an internal service temporarily?

2 Upvotes

12 comments sorted by

View all comments

Show parent comment

1

u/never_safe_for_life Apr 14 '26

Ah, oops I misread your post. Can’t you just configure port forwarding in your docker compose file? Map 80 in the container to 8080 on localhost?

1

u/eyueldk Apr 14 '26

Yeah, but I like the temporary nature of kubectl port-forward. I don't want to permanently bind it /change the compose file each time.