# How to have local conectivity with docker image?

**URL:** <https://forums.percona.com/t/how-to-have-local-conectivity-with-docker-image/15549>\
**Category:** Percona Server for MySQL\
**Tags:** percona\
**Created:** [May 4, 2022, 6:23pm UTC](https://forums.percona.com/t/how-to-have-local-conectivity-with-docker-image/15549 "2022-05-04T18:23:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gcb](https://avatars.discourse-cdn.com/v4/letter/g/bbe5ce/32.png) [@gcb](https://forums.percona.com/u/gcb)\
**Post date:** [May 4, 2022, 6:23pm UTC](https://forums.percona.com/t/how-to-have-local-conectivity-with-docker-image/15549/1 "2022-05-04T18:23:04Z")

</div>

following [Running Percona Server for MySQL in a Docker Container — Percona Server 8.0 Documentation](https://www.percona.com/doc/percona-server/8.0/installation/docker.html)

the first command doesn’t expose a network and assume you will use docker veth setup to attach another container.

My goal is to reach the server with my local development for tests (outside of docker)

i tried starting it up with

```auto
docker run -d \
  --network=host \
  --name ps \
  -e MYSQL_ROOT_PASSWORD=root \
  percona/percona-server:8.0

```

and even passing `"--port=3306"`

Also tried to wrap it in another Dockerfile that was basically:

```auto
FROM percona/percona-server:8.0
EXPOSE 3306

```

But no matter what, i never get any port listening from the container. Is this image socket only?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [May 4, 2022, 9:42pm UTC](https://forums.percona.com/t/how-to-have-local-conectivity-with-docker-image/15549/2 "2022-05-04T21:42:24Z")

</div>

Launch the container using docker port mapping to access MySQL within the container from outside.  
[https://www.percona.com/doc/percona-server/8.0/installation/docker.html#port-forwarding](https://www.percona.com/doc/percona-server/8.0/installation/docker.html#port-forwarding)
