docker_commander 3.1.0
docker_commander: ^3.1.0 copied to clipboard
A Docker manager for local and remote host machines. Works with personalized containers and pre-configured popular containers, like PostgreSQL, Apache HTTPD and NGINX.
3.1.0 #
-
DockerRunOptions: every option of adocker run/docker create, in one class that builds the CLI arguments (toArgs) and the JSON sent to a remote host (toJson/fromJson). Local and remote hosts and the console all accept it.DockerCommander.run,DockerCommander.createContainer,DockerHost.run,DockerHost.createContainerandDockerContainerConfigtake a newoptionsparameter, merged over the existing named parameters, which keep working.- New options:
tmpfs,shmSize,memory,cpus,ulimits,user,workdir,entrypoint,init,stopSignal,stopTimeout,platform,pull,labels,addHosts, andextraArgsfor anything not modelled yet. DockerHost.buildContainerArgsWithOptionsbuilds the arguments;buildContainerArgsnow delegates to it.DockerHostLocal.buildContainerArgsno longer takesaddCIDFile(moved tobuildContainerArgsWithOptions).
- New options:
-
Host ports chosen by Docker: a host port of
0(ports: ['0:5432'], orhostPort: 0in the container configs) publishes on a free host port. The chosen port is resolved once the container is ready:DockerContainer.hostPortFor(5432),DockerContainer.portsandDockerCommander.getContainerPortMappings. No race between parallel runs picking the same port. -
Labels and cleanup: every container run or created is labelled with its session (
docker_commander.session).DockerCommander.cleanupSession,removeContainersByLabelandlistContainersByLabel.
-
Reuse:
DockerRunOptions(reuse: true)attaches to a running container started with the same image and options (found by a config-hash label), following its logs, instead of starting a new one.DockerContainer.isReused. The hash leaves out the session label, so other sessions and remote clients find the same container. Only forrun. -
Health checks:
DockerContainer.waitHealthyandhealthStatus. -
Images:
DockerCommander.imageExists,pullImageandensureImage. -
PostgreSQLContainerConfig:settings(each-c key=value),initdbArgs(POSTGRES_INITDB_ARGS),extraEnvironmentandoptions.ephemeral: a throwaway database for tests:fsync,synchronous_commitandfull_page_writesoff,initdb --no-sync, and the data directory on atmpfsmount (throughPGDATA, so it doesn't depend on the image's default data path).PostgreSQLContainer.runSQLScript: runs a SQL script of any size, with line-breaks and quotes, throughpsql -v ON_ERROR_STOP=1 -f. The script is copied withdocker cp, or, through a remote host (no temporary files), written in chunks that fit in a command-line argument.- Removed a leftover
printfrom the ready check. - The empty-password error no longer prints the user name.
-
MySQLContainerConfig:settings(each--key=value),extraEnvironment,ephemeral(durability off, no binary log, data directory ontmpfs) andoptions. -
Fixes:
- The health options (
healthCmd,healthInterval,healthRetries,healthStartPeriod,healthTimeout) were accepted but never passed to Docker. They are now. DockerCommander.rundroppedrestart. It now passes it, and a restart policy other thannocombined withcleanContainer(--rm, the default ofrun) throws anArgumentErrorbefore contacting Docker (which would refuse it): passcleanContainer: false. SeeDockerRunOptions.validate.DockerHost.getContainerIDByNameuseddocker ps -f name=..., which matches any name containing the given one (app-7also matchedapp-70, returning both IDs), and returned a truncated 12-character ID while a container started byrunhas the full ID (from--cidfile). It now usesdocker container inspect: an exact match, and the full ID.docker_commander_server: a remoterunwithimageArgsfailed casting the decoded JSON list toList<String>.- The server's
createresponse now returns the normalized ports, network and hostname. - Output could be incomplete right after a process exited:
- Remote:
waitExit(and sowaitStdout,runSQL,psqlCMD,execCat...) returned as soon as the server reported the exit, while the output was still being synced in the background. It now fetches the remaining output first. Output syncs run one at a time, so they can't add the same entries twice. - Local: the exit was recorded when
Process.exitCodecompleted, which can be before STDOUT/STDERR are fully read. It now waits for them (up to 5s).
- Remote:
- A volume with an empty container path no longer produces
-v host:. DockerRunOptions.normalizePortskeeps a port bound to an IP (127.0.0.1:80:80) as it is.
- The health options (
-
README: the PostgreSQL example used
PostgreSQLContainer()instead ofPostgreSQLContainerConfig().
3.0.1 #
-
DockerCommander.close: now awaitsdockerHost.close()inside thetry, so a failure while closing is actually caught by the surroundingcatchinstead of escaping as an unhandled asynchronous error. -
Dependency updates:
swiss_knife: ^3.3.14apollovm: ^2.31.0test: ^1.32.0
3.0.0 #
-
apollovm:^0.0.53→^2.0.0.- ApolloVM 2.0.0 no longer depends on
wasm_run, which dragged an FFI/Rust toolchain and a long-abandonedflutter_rust_bridge1.x into every consumer ofdocker_commander. That pinnedshelf_web_socket ^1.0.2/web_socket_channel ^2.2.0transitively, locking dependents out of a modern shelf/WebSocket stack. - The formulas API is unchanged; this is a major release because
DockerCommanderFormulaSource.getVM()exposes ApolloVM types in its public API. - Wasm execution is not used by the formulas engine, so
apollovm_wasmis not needed here.
- ApolloVM 2.0.0 no longer depends on
-
DockerCommanderFormula: a formula with no fields now runs its commands on a class instance, like any other formula.- ApolloVM builds a class instance only when it is given instance fields, and
now rejects calling a non-static method without a
this. Since formula commands are non-static methods, a field-less formula (GitLabFormula,ApacheFormula) failed with "Can't call non-static method 'X.getVersion' without a class instance". It previously ran against a missingthisby accident.
- ApolloVM builds a class instance only when it is given instance fields, and
now rejects calling a non-static method without a
2.1.8 #
-
DockerCMD:copyFileToContainerandcopyFileFromContainer: updated input validation to use block braces for clarity.
-
DockerCommanderConsole:- Removed default case returning
falsein command output handling switch.
- Removed default case returning
-
ConsoleCMD:- Removed default case setting
typeStrtonullin return type string conversion.
- Removed default case setting
-
Configuration:
- Updated Dart SDK constraint to
>=3.6.0 <4.0.0. - Dependency updates:
swiss_knife: ^3.3.5mercury_client: ^2.3.0collection: ^1.19.1test: ^1.29.0
- Updated Dart SDK constraint to
2.1.7 #
-
PostgreSQLContainerConfig:postgresPort,maxConnections,logStatement.
-
MySQLContainerConfig:_buildImageArgs: IgnoreforceNativePasswordAuthenticationfor version 9+ (and latest).
-
swiss_knife: ^3.2.2
-
mercury_client: ^2.2.4
-
logging: ^1.3.0
-
test: ^1.25.8
-
path: ^1.9.1
2.1.6 #
-
PostgreSQLContainerConfig,MySQLContainerConfig,ApacheHttpdContainerConfig,NginxContainerConfig:- Constructor: expose
versionparameter.
- Constructor: expose
-
MySQLContainerConfig:- Fix
_buildImageArgsfor version8.4.0+.
- Fix
-
swiss_knife: ^3.2.0
-
mercury_client: ^2.2.2
-
apollovm: ^0.0.53
-
version: ^3.0.2
-
test: ^1.25.5
-
path: ^1.9.0
2.1.5 #
- apollovm: ^0.0.45
2.1.4 #
- apollovm: ^0.0.43
2.1.3 #
- apollovm: ^0.0.42
2.1.2 #
- apollovm: ^0.0.41
- dependency_validator: ^3.2.3
2.1.1 #
- mercury_client: ^2.2.0
- apollovm: ^0.0.32
2.1.0 #
-
sdk: '>=3.0.0 <4.0.0'
-
swiss_knife: ^3.1.5
-
mercury_client: ^2.1.8
-
logging: ^1.2.0
-
collection: ^1.18.0
-
apollovm: ^0.0.31
-
lints: ^2.1.1
-
test: ^1.24.6
-
dependency_validator: ^3.2.2
-
path: ^1.8.3
2.0.15 #
- Fix
DockerHostinitialization concurrence issue. DockerHost.- Added
isDaemonRunning.
- Added
2.0.14 #
OutputStream:- Improve handling of multiple lines.
DockerContainerConfig:- Improved ready functions:
MySQLContainerConfigPostgreSQLContainerConfig(updated)ApacheHttpdContainerConfigNginxContainerConfig
- Improved ready functions:
- Organize imports.
- Improve GitHub CI.
- sdk: '>=2.15.0 <3.0.0'
- swiss_knife: ^3.1.1
- mercury_client: ^2.1.6
- collection: ^1.16.0
- lints: ^2.0.0
- test: ^1.21.3
- dependency_validator: ^3.2.0
- pubspec: ^2.3.0
- path: ^1.8.2
2.0.13 #
- Added
MySQLContainer.
2.0.12 #
DockerCMD.execShell: improved inline script normalization.- Added
getFreeListenPort. - Classes that extends
DockerContainerConfignow have a suffixconfig:NginxContainerConfig,PostgreSQLContainerConfig,ApacheHttpdContainerConfig.
PostgreSQLContainer:- Added
runSQLandpsqlCMD.
- Added
- Improved containers tests.
- Added test tag
no_docker, for tests that won't use the Docker Daemon.
2.0.11 #
apollovmcompatibility.- Migrated from
pedantictolints. - Fixed issue with
FormulaandoverwriteField. - Improved support for Docker on
Windows. - Improved tests.
- apollovm: ^0.0.30
- swiss_knife: ^3.0.8
- mercury_client: ^2.1.0
- lints: ^1.0.1
- dependency_validator: ^3.1.0
2.0.10 #
formulaExec: added fields option.- Improve
gitlabformula. docker_commander_console: added get-formulas-fields.- apollovm: ^0.0.22
2.0.9 #
- Improved formulas test.
- apollovm: ^0.0.21
2.0.8 #
- Add to
DockerCommanderformula commands:listFormulasNamesgetFormulaClassNamelistFormulasFunctionsformulaExec
docker_commander_console:- Added formulas commands.
- Improve GitLab formula with class fields.
- Fix server issue with invalid request.
- apollovm: ^0.0.20
2.0.7 #
- apollovm: ^0.0.19
2.0.6 #
- Added GitLab Formula:
GitLabFormulaSource - apollovm: ^0.0.16
2.0.5 #
- Added
restartto create/run container command. - Added command
create-networktodocker_commander_console. - Improve
README.mdFormulas section.
2.0.4 #
- Formula repository (
DockerCommanderFormulaRepository):- Standard implementation:
DockerCommanderFormulaRepositoryStandard:formulas/apache_formula.dart
- Standard implementation:
- Fix formula class name to
DockerCommanderFormula - Adjust
README.mdto show a formula example.
2.0.3 #
- Remove container: added
forceparameter. - Create/run container: added health check parameters.
DockerCommanderConsole:- Added command remove-container:
- Initial version of formulas:
DockerCommanderFormular. - apollovm: ^0.0.14
- Parses and executes formulas.
2.0.2 #
Dockerfile: using AOT (native) compilation to execute the server, with better response time and memory management.
2.0.1 #
- Null Safety adjustments.
- Fix
ConsoleCMDparse of properties. - Improve read of container ID.
2.0.0 #
- Dart 2.12.0:
- Sound null safety compatibility.
- Update CI dart commands.
- sdk: '>=2.12.0 <3.0.0'
- swiss_knife: ^3.0.6
- mercury_client: ^2.0.2
- logging: ^1.0.1
- collection: ^1.15.0
1.0.23 #
- Added
DockerHostServer.checkAuthenticationBasicSecurity.
1.0.22 #
- Fix version self reference.
1.0.21 #
- Improve
consolelogcommand output.
1.0.20 #
- Improve console
stdout/stderroutput. Dockerfile:--serverand--consolemodes.README.md: improved Docker image usage.
1.0.19 #
- Improve console commands.
- Dart 2.12.0+ compliant: change DockerFile to use
dart runinstead ofdart pub run.
1.0.18 #
- Added executable
docker_commander_console: a console terminal to control adocker_commander_server. - Fix
DockerHostRemoteoutput consumer. - README: Improve Docker Image usage.
- Dart 2.12.0+ compliant:
dartfmtanddartanalyzer. - swiss_knife: ^2.5.26
- mercury_client: ^1.1.19
1.0.17 #
docker_commander_server.dart: better console output.- Fixed
pathdependency. - README: Added Docker Image usage.
1.0.16 #
- Improve live mapping of hosts in the same network: avoid mapping of already mapped hosts.
- Added executable
docker_commander_server. - Added Dockerfile for Docker Hub integration and
docker_commander/serverimage. - Fixed server response issue to encode UTF-8 characters.
1.0.15 #
- Added support to containers and services logs.
DockerProcess: now has adisposemethod, to finish any stdout/stderr consumer/client.
1.0.14 #
- Force usage of
cidfilefor better id resolution. - Add Swarm mode and Services support.
- Added Swarm tests.
1.0.13 #
- Add support to create a container and start it.
- Add volume parameters for
runandcreateContainer.
1.0.12 #
- Improve example.
- Improve README.
- Improve documentation.
- Fix typo.
1.0.11 #
- Improve NGINX integration.
- Improve README.
DockerHostRemote: ensure thatwaitReadyis called in initialization.
1.0.10 #
NginxContainer: NGINX container with aNginxReverseProxyConfigurer.- Added support to include in each container of the same network the IP of other hosts.
- Added command helpers
execShell,putFileandappendFile. - Added helpers to wait data in stdout/stderr:
waitDatawaitForDataMatch. - Fix remote operations:
wait_readyandwait_exit.
1.0.9 #
DockerHost.runandDockerHost.exec:- exposed parameter
outputReadyType.
- exposed parameter
- Fixed
DockerProcessRemoteandDockerRunnerRemoteto use local resolution of output ready state. - Fixed sync of outputs of
DockerProcessRemote:- now retries in case of network error and also finalizes sync loop,
also checking if
DockerProcessRemotewas finished.
- now retries in case of network error and also finalizes sync loop,
also checking if
- Fixed read of
--cidfile: now waits for the CID file to exist. - Added
ApacheHttpdContainerexample toREADME.md.
1.0.8 #
- Fix
stopcommand forDockerHostRemoteandDockerHostServer.
1.0.7 #
- Added support for Docker exec.
DockerProcess: to handleexeccalls.execWhich: to facilitate binary path resolution inside containers.execCat: tocata file inside the container.
- Added
ApacheHttpdContainer, to run a pre-configure Apache HTTPD. - Improved
OutputandOutputStream:- Correctly detects that associated
DockerProcessexited. - Improved ready state with
OutputReadyType. DockerHostRemote:OutputClientnow sleeps when sync doesn't receive data, to reduce number of calls.
- Correctly detects that associated
1.0.6 #
- Change libraries:
docker_commander.dart: standard and portable, even works in the browser throughDockerHostRemote.docker_commander_vm.dart: VM exclusive features, likeDockerHostLocalandDockerHostServer.
- Fix Server token validation and ensure authentication in all operations.
1.0.5 #
- Fix libraries names.
1.0.4 #
- Fix library exports.
- Added
timeoutparameters to stop methods. - Organize imports.
- Improved README.md examples.
1.0.3 #
- Added support to be used in the browser (only with
DockerHostRemote). DockerHost.run()new parameters:- imageArgs
- ports
- network
- hostname
- environment
- Added
DockerContainerConfig, for pre-configured containers. - Added
PostgreSQLContainer, using pre-configuredDockerContainerConfig.
1.0.2 #
- Added
DockerHostRemoteandDockerHostServer. DockerHost:- getRunnersInstanceIDs
- getRunnersNames
- getRunnerByInstanceID
- getRunnerByName
- stopByInstanceID
- stopByName
- stopRunners
DockerRunner:- isRunning
- Tests now runs with
locaandremotecontexts.
1.0.1 #
- Fix README.
1.0.0 #
- Initial version.