diff --git a/docs/commands/d2-cluster.md b/docs/commands/d2-cluster.md index 62bab703..57e3b073 100644 --- a/docs/commands/d2-cluster.md +++ b/docs/commands/d2-cluster.md @@ -23,7 +23,7 @@ Which will output something like this: ```sh Commands: - d2 cluster compose Run arbitrary docker-compose commands + d2 cluster compose Run arbitrary docker compose commands against a DHIS2 cluster. NOTE: pass -- after [aliases: c] d2 cluster db Manage the database in a DHIS2 Docker diff --git a/packages/cluster/src/commands/compose.js b/packages/cluster/src/commands/compose.js index 2fd92c72..5d3d4085 100644 --- a/packages/cluster/src/commands/compose.js +++ b/packages/cluster/src/commands/compose.js @@ -13,7 +13,7 @@ const run = async function (argv) { const cfg = await resolveConfiguration(argv) const args = _.slice(_.findIndex(x => x === 'compose') + 1) - reporter.debug('Passing arguments to docker-compose', args) + reporter.debug('Passing arguments to docker compose', args) const cacheLocation = await initDockerComposeCache({ composeProjectName: name, @@ -27,9 +27,9 @@ const run = async function (argv) { process.exit(1) } const res = await tryCatchAsync( - 'exec(docker-compose)', + 'exec(docker compose)', spawn( - 'docker-compose', + 'docker compose', [ '-p', makeComposeProject(name), @@ -47,14 +47,14 @@ const run = async function (argv) { ) ) if (res.err) { - reporter.error('Failed to run docker-compose command') + reporter.error('Failed to run docker compose command') process.exit(1) } } module.exports = { command: 'compose ', - desc: 'Run arbitrary docker-compose commands against a DHIS2 cluster.\nNOTE: pass -- after ', + desc: 'Run arbitrary docker compose commands against a DHIS2 cluster.\nNOTE: pass -- after ', aliases: 'c', handler: run, } diff --git a/packages/cluster/src/commands/down.js b/packages/cluster/src/commands/down.js index b8faf9f6..132eaca5 100644 --- a/packages/cluster/src/commands/down.js +++ b/packages/cluster/src/commands/down.js @@ -28,7 +28,7 @@ const run = async function (argv) { reporter.info(`Winding down cluster ${chalk.cyan(name)}`) try { await exec({ - cmd: 'docker-compose', + cmd: 'docker compose', args: [ '-p', makeComposeProject(name), @@ -46,7 +46,7 @@ const run = async function (argv) { }) } } catch (e) { - reporter.error('Failed to execute docker-compose', e) + reporter.error('Failed to execute docker compose', e) process.exit(1) } } diff --git a/packages/cluster/src/commands/logs.js b/packages/cluster/src/commands/logs.js index 1b726252..27a3ae92 100644 --- a/packages/cluster/src/commands/logs.js +++ b/packages/cluster/src/commands/logs.js @@ -36,9 +36,9 @@ const run = async function (argv) { ) const res = await tryCatchAsync( - 'exec(docker-compose)', + 'exec(docker compose)', exec({ - cmd: 'docker-compose', + cmd: 'docker compose', args: [ '-p', makeComposeProject(name), diff --git a/packages/cluster/src/commands/restart.js b/packages/cluster/src/commands/restart.js index 8a28b270..2449bad7 100644 --- a/packages/cluster/src/commands/restart.js +++ b/packages/cluster/src/commands/restart.js @@ -30,9 +30,9 @@ const run = async function (argv) { } reporter.info(`Spinning up cluster version ${chalk.cyan(name)}`) const res = await tryCatchAsync( - 'exec(docker-compose)', + 'exec(docker compose)', exec({ - cmd: 'docker-compose', + cmd: 'docker compose', args: [ '-p', makeComposeProject(name), diff --git a/packages/cluster/src/commands/up.js b/packages/cluster/src/commands/up.js index 13c8ccad..0db79266 100644 --- a/packages/cluster/src/commands/up.js +++ b/packages/cluster/src/commands/up.js @@ -35,10 +35,10 @@ const run = async function (argv) { if (update) { reporter.info('Pulling latest Docker images...') const res = await tryCatchAsync( - 'exec(docker-compose)::pull', + 'exec(docker compose)::pull', exec({ env: makeEnvironment(cfg), - cmd: 'docker-compose', + cmd: 'docker compose', args: [ '-p', makeComposeProject(name), @@ -70,10 +70,10 @@ const run = async function (argv) { reporter.info(`Spinning up cluster ${chalk.cyan(name)}`) const res = await tryCatchAsync( - 'exec(docker-compose)', + 'exec(docker compose)', exec({ env: makeEnvironment(cfg), - cmd: 'docker-compose', + cmd: 'docker compose', args: [ '-p', makeComposeProject(name), @@ -86,7 +86,7 @@ const run = async function (argv) { }) ) if (res.err) { - reporter.error('Failed to spin up cluster docker-compose cluster') + reporter.error('Failed to spin up cluster docker compose cluster') process.exit(1) } } diff --git a/packages/cluster/src/common.js b/packages/cluster/src/common.js index 23869b74..8d451de0 100644 --- a/packages/cluster/src/common.js +++ b/packages/cluster/src/common.js @@ -225,7 +225,7 @@ module.exports.makeEnvironment = cfg => { return env } -// This has to match the normalization done by docker-compose to reliably get container statuses +// This has to match the normalization done by docker compose to reliably get container statuses // from https://github.com/docker/compose/blob/c8279bc4db56f49cf2e2b80c8734ced1c418b856/compose/cli/command.py#L154 const normalizeName = name => name.replace(/[^-_a-z0-9]/g, '') diff --git a/packages/cluster/src/helpers/db/backup.js b/packages/cluster/src/helpers/db/backup.js index 893deb14..1207f806 100644 --- a/packages/cluster/src/helpers/db/backup.js +++ b/packages/cluster/src/helpers/db/backup.js @@ -29,7 +29,7 @@ module.exports = async ({ cacheLocation, name, path: dbPath, fat }) => { args: [destinationFile, fat ? 'full' : ''], pipe: false, env: { - DOCKER_COMPOSE: `docker-compose -p ${composeProject}`, + DOCKER_COMPOSE: `docker compose -p ${composeProject}`, }, }) } diff --git a/packages/cluster/src/helpers/db/restore.js b/packages/cluster/src/helpers/db/restore.js index e870d05d..fab325ac 100644 --- a/packages/cluster/src/helpers/db/restore.js +++ b/packages/cluster/src/helpers/db/restore.js @@ -40,7 +40,7 @@ const restoreFromFile = async ({ cacheLocation, dbFile, name }) => { args: [dbFile], pipe: false, env: { - DOCKER_COMPOSE: `docker-compose -p ${makeComposeProject(name)}`, + DOCKER_COMPOSE: `docker compose -p ${makeComposeProject(name)}`, }, }) } diff --git a/packages/main/src/commands/debug/system.js b/packages/main/src/commands/debug/system.js index ca712739..0881012a 100644 --- a/packages/main/src/commands/debug/system.js +++ b/packages/main/src/commands/debug/system.js @@ -5,7 +5,7 @@ const run = async () => { const info = await envInfo.run( { System: ['OS', 'CPU', 'Memory', 'Shell'], - Binaries: ['Node', 'Yarn', 'npm', 'docker-compose', 'docker'], + Binaries: ['Node', 'Yarn', 'npm', 'docker'], Utilities: ['Git'], Virtualization: ['Docker', 'Docker Compose'], IDEs: ['VSCode', 'Sublime Text'],