dsmt 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -6,7 +6,7 @@ const program = new Command();
6
6
  program
7
7
  .name("dsmt")
8
8
  .description("Docker Storage Migration Tool")
9
- .version("0.2.0");
9
+ .version("0.3.0");
10
10
  program
11
11
  .command("export")
12
12
  .argument("<src>", "volume name or bind mount path")
@@ -7,6 +7,10 @@ import { volumeCreate, volumeList } from "./volume.js";
7
7
  */
8
8
  export async function run(options) {
9
9
  const { name, rm, mounts, volumes, tty, image, cmdArgs } = options;
10
+ const localImagesList = await imageList();
11
+ if (!localImagesList.includes(image)) {
12
+ await imagePull(image);
13
+ }
10
14
  let hostConfig = {
11
15
  AutoRemove: rm,
12
16
  Binds: volumes?.map((v) => `${v.Name}:${v.Mountpoint}`),
@@ -25,7 +29,6 @@ export async function run(options) {
25
29
  Cmd: cmdArgs,
26
30
  });
27
31
  await containerStart(containerId);
28
- await containerWait(containerId);
29
32
  }
30
33
  const docker = {
31
34
  run,
package/package.json CHANGED
@@ -1,25 +1,33 @@
1
1
  {
2
2
  "name": "dsmt",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Docker Storage Migration Tool",
5
5
  "type": "module",
6
6
  "bin": {
7
- "dsmt": "./dist/cli.js"
7
+ "dsmt": "dist/cli.js"
8
8
  },
9
9
  "scripts": {
10
- "dev": "tsc -w",
10
+ "dev": "tsc --watch --preserveWatchOutput",
11
11
  "build": "tsc"
12
12
  },
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git+https://github.com/itskdhere/dsmt.git"
16
16
  },
17
- "author": "itskdhere",
18
- "license": "MIT",
19
17
  "bugs": {
20
18
  "url": "https://github.com/itskdhere/dsmt/issues"
21
19
  },
22
20
  "homepage": "https://github.com/itskdhere/dsmt#readme",
21
+ "author": "itskdhere",
22
+ "license": "MIT",
23
+ "keywords": [
24
+ "dsmt",
25
+ "cli",
26
+ "docker",
27
+ "storage",
28
+ "migration",
29
+ "tool"
30
+ ],
23
31
  "dependencies": {
24
32
  "axios": "^1.8.4",
25
33
  "chalk": "^5.4.1",
@@ -27,6 +35,7 @@
27
35
  "ora": "^8.2.0"
28
36
  },
29
37
  "devDependencies": {
38
+ "@dsmt/tsconfig": "workspace:*",
30
39
  "@types/node": "^22.14.1",
31
40
  "typescript": "^5.8.3"
32
41
  }
package/CONTRIBUTING.md DELETED
@@ -1,99 +0,0 @@
1
- # Contributing to Docker Storage Migration Tool (DSMT)
2
-
3
- Thank you for considering contributing to DSMT! This document provides guidelines and instructions to help you contribute effectively.
4
-
5
- ## Code of Conduct
6
-
7
- This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.
8
-
9
- ## How Can I Contribute?
10
-
11
- ### Reporting Bugs
12
-
13
- Before submitting a bug report:
14
-
15
- - Check the [issue tracker](https://github.com/itskdhere/dsmt/issues) to see if the issue has already been reported
16
- - If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/itskdhere/dsmt/issues/new?template=bug_report.md)
17
-
18
- When filing a bug report, please include:
19
-
20
- - A clear and descriptive title
21
- - Steps to reproduce the issue
22
- - Expected and actual behavior
23
- - System information (OS, Docker version, Node.js version)
24
- - Any relevant logs or error messages
25
-
26
- ### Suggesting Features
27
-
28
- We welcome feature suggestions! [Open an issue](https://github.com/itskdhere/dsmt/issues/new?template=feature_request.md) with your idea, providing as much context and detail as possible.
29
-
30
- ### Pull Requests
31
-
32
- 1. Fork the repository
33
- 2. Create a new branch for your feature or bugfix
34
- 3. Make your changes
35
- 4. Ensure your code follows the project style and passes all tests
36
- 5. Submit a pull request
37
-
38
- ## Development Setup
39
-
40
- ```bash
41
- # Clone your fork of the repo
42
- git clone https://github.com/YOUR-USERNAME/dsmt.git
43
- cd dsmt
44
-
45
- # Install dependencies
46
- npm install
47
-
48
- # Start development mode (watches for changes)
49
- npm run dev
50
-
51
- # Link the package globally for testing
52
- npm link
53
- ```
54
-
55
- ## Project Structure
56
-
57
- - cli.ts - CLI entry point
58
- - cmd - Command implementations
59
- - docker - Docker API wrapper
60
- - types - TypeScript type definitions
61
-
62
- ## Coding Guidelines
63
-
64
- - Use TypeScript for all new code
65
- - Follow existing code style (2 spaces for indentation)
66
- - Add appropriate error handling and logging
67
- - Document new functions and methods
68
-
69
- ## Commit Messages
70
-
71
- - Use the present tense ("Add feature" not "Added feature")
72
- - Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
73
- - Limit the first line to 72 characters
74
- - Reference issues and pull requests liberally after the first line
75
-
76
- ## Testing Your Changes
77
-
78
- Please ensure your changes work properly with:
79
-
80
- - Different types of Docker volumes
81
- - Bind mounts with various path structures
82
- - Different operating systems (if possible)
83
-
84
- ## Submitting Changes
85
-
86
- 1. Push your changes to your fork
87
- 2. Submit a pull request to the main repository
88
- 3. The title of your PR should clearly describe the change
89
- 4. Link any relevant issues in the PR description
90
-
91
- ## License
92
-
93
- By contributing to DSMT, you agree that your contributions will be licensed under the project's MIT License.
94
-
95
- ## Questions?
96
-
97
- Feel free to open an issue if you have any questions about contributing.
98
-
99
- Thank you for contributing to DSMT!
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Krishnendu Das
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/README.md DELETED
@@ -1,85 +0,0 @@
1
- # 🐳 Docker Storage Migration Tool 📦
2
-
3
- `dsmt` is a command-line utility for seamlessly exporting and importing Docker volumes and bind mounts.
4
-
5
- ## 🔍 Overview
6
-
7
- DSMT (Docker Storage Migration Tool) provides a simple way to:
8
-
9
- - 📤 Export Docker volumes or bind mounts to compressed tarballs.
10
- - 📥 Import compressed tarballs into Docker volumes or bind mounts.
11
-
12
- 🔄 This tool makes it easy to backup, restore, or migrate Docker storage across systems.
13
-
14
- ## 💻 Installation
15
-
16
- ```bash
17
- npm install -g dsmt
18
- ```
19
-
20
- ## 🚀 Usage
21
-
22
- ### 📤 Exporting Docker Storage
23
-
24
- Export a Docker volume:
25
-
26
- ```bash
27
- dsmt export volume_name /path/to/export/directory
28
- ```
29
-
30
- Export a bind mount:
31
-
32
- ```bash
33
- dsmt export /path/to/bind/mount /path/to/export/directory
34
- ```
35
-
36
- ### 📥 Importing Docker Storage
37
-
38
- Import to a Docker volume:
39
-
40
- ```bash
41
- dsmt import /path/to/tarball.tar.gz volume_name
42
- ```
43
-
44
- Import to a bind mount:
45
-
46
- ```bash
47
- dsmt import /path/to/tarball.tar.gz /path/to/bind/mount
48
- ```
49
-
50
- ## ⚙️ Options
51
-
52
- Both commands support the following options:
53
-
54
- - `-v, --volume`: Explicitly specify source/destination as a Docker volume
55
- - `-b, --bind`: Explicitly specify source/destination as a bind mount
56
-
57
- The tool will automatically detect the source/destination type in most cases, but you can use these flags to be explicit.
58
-
59
- ## 📋 Examples
60
-
61
- ```bash
62
- # Export a volume named 'mongodb_data' to the current directory
63
- dsmt export mongodb_data ./
64
-
65
- # Import a tarball to a new volume
66
- dsmt import ./mongodb_data.tar.gz new_mongodb_data
67
-
68
- # Export a bind mount to the /backups directory
69
- dsmt export /var/www/html /backups
70
-
71
- # Import a tarball to a bind mount
72
- dsmt import ./html.tar.gz /var/www/html
73
- ```
74
-
75
- ## 🛠️ Contribution
76
-
77
- Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file for guidelines on contributing to this project.
78
-
79
- ## 🔒 Security
80
-
81
- Please refer to the [SECURITY.md](SECURITY.md) file for security-related issues and reporting.
82
-
83
- ## 📄 License
84
-
85
- MIT © [itskdhere](https://github.com/itskdhere)
package/SECURITY.md DELETED
@@ -1,12 +0,0 @@
1
- # Security Policy
2
-
3
- ## Supported Versions
4
-
5
- | Version | Supported |
6
- | ------- | ------------------ |
7
- | > 0.2.0 | :white_check_mark: |
8
-
9
- ## Reporting a Vulnerability
10
-
11
- :octocat: https://github.com/itskdhere/dsmt/security/advisories/new
12
- 📧 [support@itskdhere.eu.org](mailto:support@itskdhere.eu.org)