Skip to content

Commit aeb335a

Browse files
authored
improve mysql container support (#1711)
1 parent 5dc3d28 commit aeb335a

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): 1, 1.16, 1.17, 1-bullseye, 1.16-bullseye, 1.17-bullseye, 1-buster, 1.16-buster, 1.17-buster
2-
ARG VARIANT=1.17-bullseye
2+
ARG VARIANT=1.18-bullseye
33
FROM mcr.microsoft.com/vscode/devcontainers/go:0-${VARIANT}
44

55
# [Optional] If your requirements rarely change, uncomment this section to add them to the image.

.devcontainer/docker-compose.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@ services:
66
context: ..
77
dockerfile: .devcontainer/Dockerfile
88
args:
9-
VARIANT: 1.17-bullseye
9+
VARIANT: 1.18-bullseye
1010

1111
volumes:
1212
- ..:/workspace:cached
1313

1414
# Overrides default command so things don't shut down after the process ends.
1515
command: sleep infinity
1616

17+
links:
18+
- mysql
19+
- postgresql
20+
1721
environment:
1822
PG_HOST: postgresql
1923
PG_USER: postgres
@@ -24,13 +28,14 @@ services:
2428
MYSQL_ROOT_PASSWORD: mysecretpassword
2529

2630
mysql:
27-
image: "mysql:8"
31+
image: "mysql/mysql-server:8.0"
2832
ports:
2933
- "3306:3306"
3034
restart: unless-stopped
3135
environment:
3236
MYSQL_DATABASE: dinotest
3337
MYSQL_ROOT_PASSWORD: mysecretpassword
38+
MYSQL_ROOT_HOST: '%'
3439

3540
postgresql:
3641
image: "postgres:13"
@@ -41,6 +46,5 @@ services:
4146
POSTGRES_DB: dinotest
4247
POSTGRES_PASSWORD: mysecretpassword
4348
POSTGRES_USER: postgres
44-
4549
# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
4650
# (Adding the "ports" property to this file will not forward from a Codespace.)

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
version: "3.8"
22
services:
33
mysql:
4-
image: "mysql:8"
4+
image: "mysql/mysql-server:8.0"
55
ports:
66
- "3306:3306"
77
restart: always
88
environment:
99
MYSQL_DATABASE: dinotest
1010
MYSQL_ROOT_PASSWORD: mysecretpassword
11+
MYSQL_ROOT_HOST: '%'
1112

1213
postgresql:
1314
image: "postgres:13"

0 commit comments

Comments
 (0)