@le-space/rootfs 0.1.48 → 0.1.50
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/index.js
CHANGED
|
@@ -393,6 +393,8 @@ function createDockerRootfsExecutionPlan(plan, options = {}) {
|
|
|
393
393
|
const containerProjectDir = projectMountPath;
|
|
394
394
|
const containerContractPath = containerPathForProjectFile(plan.contractPath, plan.projectDir, projectMountPath, "contractPath");
|
|
395
395
|
const containerOutDir = containerPathForProjectFile(plan.outDir, plan.projectDir, projectMountPath, "outDir");
|
|
396
|
+
const hostUid = typeof process.getuid === "function" ? String(process.getuid()) : "1000";
|
|
397
|
+
const hostGid = typeof process.getgid === "function" ? String(process.getgid()) : "1000";
|
|
396
398
|
return {
|
|
397
399
|
mode: "docker",
|
|
398
400
|
reason: "Using Dockerized Debian/libguestfs builder.",
|
|
@@ -428,6 +430,10 @@ function createDockerRootfsExecutionPlan(plan, options = {}) {
|
|
|
428
430
|
`ROOTFS_IMAGE_SIZE=${plan.rootfsImageSize}`,
|
|
429
431
|
"-e",
|
|
430
432
|
`PROJECT_DIR=${containerProjectDir}`,
|
|
433
|
+
"-e",
|
|
434
|
+
`HOST_UID=${hostUid}`,
|
|
435
|
+
"-e",
|
|
436
|
+
`HOST_GID=${hostGid}`,
|
|
431
437
|
"-v",
|
|
432
438
|
`${plan.projectDir}:${projectMountPath}`,
|
|
433
439
|
"-v",
|
package/package.json
CHANGED
|
@@ -12,6 +12,8 @@ IMAGE="${OUT_DIR}/aleph-uc-go-peer.qcow2"
|
|
|
12
12
|
APP_BINARY="${OUT_DIR}/universal-chat-go"
|
|
13
13
|
ROOTFS_IMAGE_SIZE="${ROOTFS_IMAGE_SIZE:-20G}"
|
|
14
14
|
ROOTFS_BUILD_TMPDIR=""
|
|
15
|
+
HOST_UID="${HOST_UID:-}"
|
|
16
|
+
HOST_GID="${HOST_GID:-}"
|
|
15
17
|
|
|
16
18
|
require() {
|
|
17
19
|
command -v "$1" >/dev/null 2>&1 || {
|
|
@@ -28,6 +30,7 @@ require go
|
|
|
28
30
|
|
|
29
31
|
cleanup() {
|
|
30
32
|
if [ -n "${ROOTFS_BUILD_TMPDIR}" ] && [ -d "${ROOTFS_BUILD_TMPDIR}" ]; then
|
|
33
|
+
chmod -R u+w "${ROOTFS_BUILD_TMPDIR}" 2>/dev/null || true
|
|
31
34
|
rm -rf "${ROOTFS_BUILD_TMPDIR}"
|
|
32
35
|
fi
|
|
33
36
|
}
|
|
@@ -102,3 +105,7 @@ virt-customize \
|
|
|
102
105
|
--run-command "systemctl enable ${ROOTFS_CONTRACT_MAIN_SERVICE}"
|
|
103
106
|
|
|
104
107
|
echo "Rootfs image ready at ${IMAGE}"
|
|
108
|
+
|
|
109
|
+
if [ -n "${HOST_UID}" ] && [ -n "${HOST_GID}" ]; then
|
|
110
|
+
chown -R "${HOST_UID}:${HOST_GID}" "${OUT_DIR}"
|
|
111
|
+
fi
|