mirror of
https://github.com/Lore09/Tesi-Magistrale.git
synced 2025-12-19 04:14:35 +00:00
fixed permission bug
This commit is contained in:
@@ -13,7 +13,7 @@ class Pelato:
|
|||||||
|
|
||||||
def setup_vars(self):
|
def setup_vars(self):
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv(override=True)
|
||||||
|
|
||||||
self.registry_url = os.getenv('REGISTRY_URL')
|
self.registry_url = os.getenv('REGISTRY_URL')
|
||||||
self.reg_user = os.getenv('REGISTRY_USER')
|
self.reg_user = os.getenv('REGISTRY_USER')
|
||||||
|
|||||||
@@ -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']
|
oci_url = wadm['spec']['components'][0]['properties']['image']
|
||||||
name = wadm['spec']['components'][0]['name'] + '-build'
|
name = wadm['spec']['components'][0]['name'] + '-build'
|
||||||
|
|
||||||
|
uid = os.getuid()
|
||||||
|
gid = os.getgid()
|
||||||
|
|
||||||
# Build the wasm module
|
# Build the wasm module
|
||||||
print(f" - Building WASM module {oci_url}")
|
print(f" - Building WASM module {oci_url}")
|
||||||
container = client.containers.run(
|
container = client.containers.run(
|
||||||
"wash-build-image:latest",
|
"wash-build-image:latest",
|
||||||
environment=[f'REGISTRY={oci_url}',
|
environment=[f'REGISTRY={oci_url}',
|
||||||
f'WASH_REG_USER={reg_user}',
|
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'}},
|
volumes={path: {'bind': '/app', 'mode': 'rw'}},
|
||||||
remove=True,
|
remove=True,
|
||||||
detach=True,
|
detach=True,
|
||||||
|
|||||||
@@ -48,4 +48,4 @@ RUN mkdir /app
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install go dependencies, build the wasm module, push it to the registry
|
# 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} ."]
|
||||||
Reference in New Issue
Block a user