File tree Expand file tree Collapse file tree 4 files changed +14
-7
lines changed
Expand file tree Collapse file tree 4 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -29,10 +29,10 @@ COPY --from=ghcr.io/foundry-rs/foundry:latest /usr/local/bin/anvil /usr/local/bi
2929# prepare user-owned data dirs for rootless startup
3030RUN mkdir -p /home/vscode/.local/share/pg/pgdata \
3131 && mkdir -p /home/vscode/.local/share/mysql \
32+ && mkdir -p /home/vscode/.local/share/tmp \
3233 && chown -R vscode:vscode /home/vscode/.local/share
3334
3435# Set environment variables based on build args
3536ENV PG_BIN_DIR=/usr/lib/postgresql/${PG_MAJOR}/bin
3637
3738USER vscode
38-
Original file line number Diff line number Diff line change 3535 "MYSQL_USER" : " singularity" ,
3636 "MYSQL_PASSWORD" : " singularity" ,
3737 "MYSQL_SOCKET" : " /home/vscode/.local/share/mysql/mysql.sock" ,
38+ "TMPDIR" : " /home/vscode/.local/share/tmp" ,
39+ "GOTMPDIR" : " /home/vscode/.local/share/tmp" ,
3840 "PGDATA" : " /home/vscode/.local/share/pg/pgdata" ,
3941 "PGPORT" : " 55432" ,
4042 "PGSOCK_DIR" : " /home/vscode/.local/share/pg"
4143 },
4244 "runArgs" : [" --userns=keep-id" ],
4345 "containerUser" : " vscode"
4446}
45-
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ chmod +x .devcontainer/*.sh || true
1010echo " Setting up databases..."
1111
1212# Create data directories
13- mkdir -p /home/vscode/.local/share/pg/pgdata /home/vscode/.local/share/pg /home/vscode/.local/share/mysql/data /home/vscode/.local/share/mysql
13+ mkdir -p /home/vscode/.local/share/pg/pgdata /home/vscode/.local/share/pg /home/vscode/.local/share/mysql/data /home/vscode/.local/share/mysql/tmp /home/vscode/.local/share/mysql /home/vscode/.local/share/tmp
1414
1515# Initialize Postgres
1616if [ ! -f " /home/vscode/.local/share/pg/pgdata/PG_VERSION" ]; then
2727# Initialize MariaDB
2828if [ ! -d " /home/vscode/.local/share/mysql/data/mysql" ]; then
2929 echo " Initializing MariaDB..."
30- mariadb-install-db --datadir=/home/vscode/.local/share/mysql/data --auth-root-authentication-method=normal --skip-test-db > /dev/null
30+ export TMPDIR=/home/vscode/.local/share/mysql/tmp
31+ mariadb-install-db \
32+ --datadir=/home/vscode/.local/share/mysql/data \
33+ --tmpdir=/home/vscode/.local/share/mysql/tmp \
34+ --auth-root-authentication-method=normal \
35+ --skip-test-db > /dev/null
3136fi
3237
3338# Start both servers
@@ -51,5 +56,3 @@ FLUSH PRIVILEGES;
5156SQL
5257
5358echo " Database setup completed successfully"
54-
55-
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ set -euo pipefail
44# MariaDB server configuration
55MYSQL_BASE=" ${HOME} /.local/share/mysql"
66DATA_DIR=" ${MYSQL_BASE} /data"
7+ TMP_DIR=" ${MYSQL_BASE} /tmp"
78SOCKET=" ${MYSQL_SOCKET:- ${MYSQL_BASE} / mysql.sock} "
89PID_FILE=" ${MYSQL_BASE} /mysql.pid"
910PORT=" ${MYSQL_PORT:- 3306} "
1718
1819# Start MariaDB server
1920echo " Starting MySQL server"
21+ mkdir -p " ${TMP_DIR} "
2022touch " ${LOG_FILE} "
2123nohup mariadbd \
2224 --datadir=" ${DATA_DIR} " \
25+ --tmpdir=" ${TMP_DIR} " \
2326 --socket=" ${SOCKET} " \
2427 --pid-file=" ${PID_FILE} " \
2528 --bind-address=127.0.0.1 \
@@ -44,4 +47,4 @@ if [ -f "${LOG_FILE}" ]; then
4447 tail -n 200 " ${LOG_FILE} " || true
4548 echo " --- End MariaDB error log ---"
4649fi
47- exit 1
50+ exit 1
You can’t perform that action at this time.
0 commit comments