updock 0.1.1
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/README.md +32 -0
- package/bin/updock.js +60 -0
- package/package.json +35 -0
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# updock
|
|
2
|
+
|
|
3
|
+
Run any Docker app from one word. No YAML, no flag-hunting.
|
|
4
|
+
|
|
5
|
+
You type a name. updock finds the image, lets you pick a version, asks only the
|
|
6
|
+
few things that actually matter (ports, passwords, env vars), writes the Compose
|
|
7
|
+
file and `.env`, and brings it up. After that you control everything by number.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g updock
|
|
13
|
+
# or run it once, without installing:
|
|
14
|
+
npx updock postgres
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Other install methods (Homebrew, go install, prebuilt binaries) are in the docs.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
updock postgres # search, pick a version, configure, run
|
|
23
|
+
updock ls # list your projects, numbered
|
|
24
|
+
updock logs 2 # everything after is controlled by number
|
|
25
|
+
updock stop 2
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Links
|
|
29
|
+
|
|
30
|
+
- Documentation: https://amrelsagaei.github.io/updock/
|
|
31
|
+
- Source and issues: https://github.com/amrelsagaei/updock
|
|
32
|
+
- License: MIT
|
package/bin/updock.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Copyright (c) 2026 Amr Elsagaei. All rights reserved.
|
|
3
|
+
//
|
|
4
|
+
// Thin launcher: resolves the platform-specific @updock/<os>-<arch> package
|
|
5
|
+
// (installed as an optional dependency) and execs the bundled binary.
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
|
|
9
|
+
const { execFileSync } = require("node:child_process");
|
|
10
|
+
|
|
11
|
+
// Map Node's platform/arch to our package naming.
|
|
12
|
+
const PLATFORM_PACKAGES = {
|
|
13
|
+
"linux-x64": "@updock/linux-x64",
|
|
14
|
+
"linux-arm64": "@updock/linux-arm64",
|
|
15
|
+
"darwin-x64": "@updock/darwin-x64",
|
|
16
|
+
"darwin-arm64": "@updock/darwin-arm64",
|
|
17
|
+
"win32-x64": "@updock/win32-x64",
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
function binaryPath() {
|
|
21
|
+
const key = `${process.platform}-${process.arch}`;
|
|
22
|
+
const pkg = PLATFORM_PACKAGES[key];
|
|
23
|
+
|
|
24
|
+
if (!pkg) {
|
|
25
|
+
throw new Error(
|
|
26
|
+
`updock: unsupported platform ${key}. ` +
|
|
27
|
+
`Download a binary from https://github.com/amrelsagaei/updock/releases`,
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const binName = process.platform === "win32" ? "updock.exe" : "updock";
|
|
32
|
+
try {
|
|
33
|
+
return require.resolve(`${pkg}/bin/${binName}`);
|
|
34
|
+
} catch {
|
|
35
|
+
throw new Error(
|
|
36
|
+
`updock: the platform package ${pkg} is not installed. ` +
|
|
37
|
+
`Reinstall with 'npm install updock', or grab a binary from ` +
|
|
38
|
+
`https://github.com/amrelsagaei/updock/releases`,
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function main() {
|
|
44
|
+
let bin;
|
|
45
|
+
try {
|
|
46
|
+
bin = binaryPath();
|
|
47
|
+
} catch (err) {
|
|
48
|
+
process.stderr.write(`${err.message}\n`);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
execFileSync(bin, process.argv.slice(2), { stdio: "inherit" });
|
|
54
|
+
} catch (err) {
|
|
55
|
+
// Propagate the child's exit code; execFileSync throws on non-zero exit.
|
|
56
|
+
process.exit(typeof err.status === "number" ? err.status : 1);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "updock",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Run any Docker app from one word.",
|
|
5
|
+
"homepage": "https://amrelsagaei.com",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Amr Elsagaei <amr.elsagaei@gmail.com>",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/amrelsagaei/updock.git"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"docker",
|
|
14
|
+
"docker-compose",
|
|
15
|
+
"cli",
|
|
16
|
+
"devtools",
|
|
17
|
+
"containers"
|
|
18
|
+
],
|
|
19
|
+
"bin": {
|
|
20
|
+
"updock": "bin/updock.js"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"bin/updock.js"
|
|
24
|
+
],
|
|
25
|
+
"optionalDependencies": {
|
|
26
|
+
"@updock/linux-x64": "0.1.1",
|
|
27
|
+
"@updock/linux-arm64": "0.1.1",
|
|
28
|
+
"@updock/darwin-x64": "0.1.1",
|
|
29
|
+
"@updock/darwin-arm64": "0.1.1",
|
|
30
|
+
"@updock/win32-x64": "0.1.1"
|
|
31
|
+
},
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=16"
|
|
34
|
+
}
|
|
35
|
+
}
|