fixed permission bug

This commit is contained in:
2025-02-21 01:17:48 +01:00
parent 4d2519462f
commit 1ff1cf4f2e
3 changed files with 8 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ class Pelato:
def setup_vars(self):
load_dotenv()
load_dotenv(override=True)
self.registry_url = os.getenv('REGISTRY_URL')
self.reg_user = os.getenv('REGISTRY_USER')

View File

@@ -70,13 +70,18 @@ def __build_wasm(task_dir, client, reg_user, reg_pass, detached, wait_list):
oci_url = wadm['spec']['components'][0]['properties']['image']
name = wadm['spec']['components'][0]['name'] + '-build'
uid = os.getuid()
gid = os.getgid()
# Build the wasm module
print(f" - Building WASM module {oci_url}")
container = client.containers.run(
"wash-build-image:latest",
environment=[f'REGISTRY={oci_url}',
f'WASH_REG_USER={reg_user}',
f'WASH_REG_PASSWORD={reg_pass}'],
f'WASH_REG_PASSWORD={reg_pass}',
f'HOST_UID={uid}',
f'HOST_GID={gid}'],
volumes={path: {'bind': '/app', 'mode': 'rw'}},
remove=True,
detach=True,

View File

@@ -48,4 +48,4 @@ RUN mkdir /app
WORKDIR /app
# Install go dependencies, build the wasm module, push it to the registry
CMD ["sh", "-c", "go env -w GOFLAGS=-buildvcs=false && go mod download && go mod verify && wash build && wash push $REGISTRY build/*.wasm"]
CMD ["sh", "-c", "go env -w GOFLAGS=-buildvcs=false && go mod download && go mod verify && wash build && wash push $REGISTRY build/*.wasm && chown -R ${HOST_UID}:${HOST_GID} ."]