Closed LennertDefauw1 closed 2 years ago
Can't help with that but I wonder what flist did you use?
I am using the following flist: https://hub.grid.tf/lennertapp2.3bot/threefoldjimber-ssh-latest.flist
This is needed to have a generic flist where we can just pass through environment variables for a Vue3 NodeJS application
Is this a full vm or container based flist?
This is the Dockerfile:
FROM ubuntu:20.04
RUN echo deb http://be.archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse >> /etc/apt/sources.list
RUN apt-get update && DEBIAN_FRONTEND=noninteractive TZ=Europe/Belgium apt-get install -y openssh-client openssh-server && rm -rf /var/lib/apt/lists/*
COPY init.sh /init.sh
RUN chmod +x /init.sh
ENTRYPOINT ["/init.sh"]
with init.sh:
#!/bin/bash
export TEST='TEST'
export USER_ID=$USER_ID
mkdir -p ~/.ssh
mkdir -p /var/run/sshd
echo $SSH_KEY >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
exec /usr/sbin/sshd -D
the env vars are available to process 1 e.g
Currently deploying an flist with the grid3 typescript client.
Giving environment variables to the VM
Logging in with ssh to the public IP, getting the environement variables returns me to
No pregiven env vars were found. Environement variables are availble in your entrypoint, but they should be available anywhere. Trying to EXPORT USER_ID = "lennertapp2" inside my entrypoint script didnt work either.