@zenera/faker 1.1.16 → 1.1.18

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.
Files changed (2) hide show
  1. package/dist/image.js +10 -6
  2. package/package.json +3 -3
package/dist/image.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createHash } from 'node:crypto';
2
- import { mkdirSync } from 'node:fs';
2
+ import { mkdirSync, writeFileSync } from 'node:fs';
3
3
  import { join } from 'node:path';
4
4
  import { DEFAULT_SANDBOX_IMAGE, runProcess } from '@zenera/neo';
5
5
  // ---------------------------------------------------------------------------
@@ -59,13 +59,17 @@ export async function ensureImage(opts) {
59
59
  return tag;
60
60
  }
61
61
  opts.onBuild?.(tag);
62
- // An empty directory, because the Containerfile arrives on stdin and there
63
- // is nothing to COPY: handing podman the working directory instead would
64
- // tar up whatever happened to be in it.
62
+ // An empty directory, because there is nothing to COPY: handing podman the
63
+ // working directory instead would tar up whatever happened to be in it.
65
64
  const context = join(opts.root, 'build');
66
65
  mkdirSync(context, { recursive: true });
67
- const built = await run(engine, ['build', '--tag', tag, '--file', '-', context], {
68
- input: containerfile(base),
66
+ // A real file rather than `--file -`: a spawned child's stdin is a
67
+ // socketpair, and a socket cannot be reopened through /dev/stdin, so the
68
+ // engine fails with ENXIO. It sits beside the context, not inside it, so
69
+ // the context stays empty.
70
+ const file = join(opts.root, 'Containerfile');
71
+ writeFileSync(file, containerfile(base));
72
+ const built = await run(engine, ['build', '--tag', tag, '--file', file, context], {
69
73
  timeoutMs: 900_000,
70
74
  maxBytes: 256 * 1024,
71
75
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenera/faker",
3
- "version": "1.1.16",
3
+ "version": "1.1.18",
4
4
  "description": "Mock HTTP server for swagger/OpenAPI documents, with response bodies generated by a model.",
5
5
  "keywords": [
6
6
  "openapi",
@@ -45,7 +45,7 @@
45
45
  "@apidevtools/swagger-parser": "^12.0.0",
46
46
  "ajv": "^8.17.1",
47
47
  "ajv-formats": "^3.0.1",
48
- "@zenera/cli": "^1.1.16",
49
- "@zenera/neo": "^1.1.16"
48
+ "@zenera/cli": "^1.1.18",
49
+ "@zenera/neo": "^1.1.18"
50
50
  }
51
51
  }