feat: refs #5483 tmpfs parameter added to run command
This commit is contained in:
parent
c893a473ed
commit
f7821d0a18
13
myt-run.js
13
myt-run.js
|
@ -19,7 +19,8 @@ class Run extends Command {
|
|||
params: {
|
||||
ci: 'Workaround for continuous integration system',
|
||||
network: 'Docker network to attach container to',
|
||||
random: 'Whether to use a random container name and port'
|
||||
random: 'Whether to use a random container name and port',
|
||||
tmpfs: 'Whether to use tmpfs mount for MySQL data'
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -27,7 +28,8 @@ class Run extends Command {
|
|||
alias: {
|
||||
ci: 'c',
|
||||
network: 'n',
|
||||
random: 'r'
|
||||
random: 'r',
|
||||
tmpfs: 'r'
|
||||
},
|
||||
boolean: [
|
||||
'ci',
|
||||
|
@ -107,12 +109,11 @@ class Run extends Command {
|
|||
}
|
||||
|
||||
if (opts.network)
|
||||
Object.assign(runOptions, {network: opts.network});
|
||||
|
||||
const runChown = process.platform != 'linux';
|
||||
runOptions.network = opts.network;
|
||||
if (opts.tmpfs)
|
||||
runOptions.tmpfs = '/var/lib/mysql';
|
||||
|
||||
Object.assign(runOptions, null, {
|
||||
env: `RUN_CHOWN=${runChown}`,
|
||||
detach: true
|
||||
});
|
||||
const ct = await docker.run(opts.code, null, runOptions);
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@verdnatura/myt",
|
||||
"version": "1.5.35",
|
||||
"version": "1.6.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@verdnatura/myt",
|
||||
"version": "1.5.35",
|
||||
"version": "1.6.1",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@sqltools/formatter": "^1.2.5",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@verdnatura/myt",
|
||||
"version": "1.6.0",
|
||||
"version": "1.6.1",
|
||||
"author": "Verdnatura Levante SL",
|
||||
"description": "MySQL version control",
|
||||
"license": "GPL-3.0",
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
FROM myt/server
|
||||
|
||||
USER root
|
||||
|
||||
WORKDIR /workspace
|
||||
COPY .dump dump/.dump
|
||||
COPY dump.*.sql dump/
|
||||
|
||||
RUN gosu mysql docker-init.sh
|
||||
RUN mkdir -p /mysql-template \
|
||||
&& chown mysql:mysql /mysql-template \
|
||||
&& gosu mysql docker-init.sh
|
||||
|
||||
RUN echo "[LOG] Import finished." \
|
||||
&& rm -rf /workspace
|
||||
&& rm -rf dump
|
||||
|
||||
COPY fixtures.*.sql dump/
|
||||
|
||||
USER mysql
|
||||
|
|
|
@ -1,13 +1,7 @@
|
|||
FROM myt/base
|
||||
|
||||
USER root
|
||||
ENV MYSQL_ROOT_PASSWORD root
|
||||
|
||||
RUN mkdir /mysql-data \
|
||||
&& chown -R mysql:mysql /mysql-data
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
COPY docker.cnf /etc/mysql/conf.d/
|
||||
COPY \
|
||||
docker-init.sh \
|
||||
|
@ -15,10 +9,7 @@ COPY \
|
|||
docker-start.sh \
|
||||
/usr/local/bin/
|
||||
|
||||
USER mysql
|
||||
|
||||
ENTRYPOINT ["docker-start.sh"]
|
||||
|
||||
CMD ["mysqld"]
|
||||
|
||||
HEALTHCHECK --interval=2s --timeout=10s --retries=200 \
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
. /usr/local/bin/docker-entrypoint.sh
|
||||
CMD=mysqld
|
||||
ARGS=(mysqld --datadir=/mysql-template)
|
||||
|
||||
mysql_check_config "$CMD"
|
||||
docker_setup_env "$CMD"
|
||||
mysql_check_config ${ARGS[@]}
|
||||
docker_setup_env ${ARGS[@]}
|
||||
docker_create_db_directories
|
||||
|
||||
docker_verify_minimum_env
|
||||
docker_init_database_dir "$CMD"
|
||||
docker_temp_server_start "$CMD"
|
||||
docker_init_database_dir ${ARGS[@]}
|
||||
docker_temp_server_start ${ARGS[@]}
|
||||
docker_setup_db
|
||||
docker_process_init_files /docker-entrypoint-initdb.d/*
|
||||
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# XXX: Workaround to avoid OverlayFS bug on MacOs
|
||||
# https://docs.docker.com/storage/storagedriver/overlayfs-driver/#limitations-on-overlayfs-compatibility
|
||||
|
||||
if [ "$RUN_CHOWN" = "true" ]; then
|
||||
chown -R mysql:mysql /mysql-data
|
||||
if [ ! -d /var/lib/mysql/mysql ]; then
|
||||
chown mysql:mysql /var/lib/mysql
|
||||
cp -a /mysql-template/. /var/lib/mysql
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
exec gosu mysql "$@"
|
||||
|
|
|
@ -3,7 +3,6 @@ innodb_log_file_size = 4M
|
|||
innodb_autoextend_increment = 4
|
||||
innodb_page_size = 16K
|
||||
log_bin_trust_function_creators = ON
|
||||
datadir = /mysql-data
|
||||
sql_mode = NO_ENGINE_SUBSTITUTION
|
||||
table_definition_cache = 1024
|
||||
skip-log-bin
|
||||
|
|
Loading…
Reference in New Issue