#48281 closed enhancement (fixed)
Expose port 3306 of MySQL container
| Reported by: | ocean90 | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.4 |
| Component: | Build/Test Tools | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
To allow accessing the container from external the port 3306 should get exposed. This is done by defining ports in the config, see https://docs.docker.com/compose/compose-file/#ports.
To retrieve the host port you can then use docker-compose port mysql 3306.
Attachments (2)
Change History (9)
#2
in reply to: ↑ 1
@
7 years ago
Replying to peterwilsoncc:
48281.2.diff accounts for users that may be exposing a database on the default port:
That’s why my patch only defines the container port to allow docker-compose to choose an ephemeral host port.
#3
@
7 years ago
+1 to this. I've tested 48281.2.diff and it works. Hopefully this gets committed soon.
48281.2.diff accounts for users that may be exposing a database on the default port:
8836