- Notifications
You must be signed in to change notification settings - Fork1k
Question: Docker containers and entrypoints - Init scripts which require to be PID 1#19393
-
Hi everyone, IntroI started using coder last year and day by day I created several templates based on one or more containers to create complex stacks to develop in node, django or several other environments. Most of them are based on linux containers. Current setupI usually run containers that were previously built to run as portainer stacks (docker compose) and translated the compose file to a terraform (based on coder and docker providers) script with the ability to build a docker image when needed during the terraform start command. Of course every time I need to start a new unknown container, I run it in docker, take note of the entrypoint command and run it as a startup_script of the coder agent. Easy, amazing results! I have a ubuntu image with XFCE and noVNC, which is really useful to run some GUI based apps remotely. ProblemToday I discoveredselkies, tested it by running the container and I noticed stronger performances when compared to the current VNC server + noVNC solution. Every pre-built image that I found with any window manager and selkies is based on QuestionIs there a way to run the agent called by another script? If yes, what's the content of the variable Anyway, the only allowed startup order is to have the coder script as entrypoint of the docker image and the original entrypoint of the image run by the startup script, like in the following example? resource"coder_agent""main" {arch=data.coder_provisioner.me.archos="linux"dir="~/${local.folder_name}"startup_script=<<-EOT set -e # Do stuff echo "Starting noVNC" USER=${local.username} vncserver -SecurityTypes None -geometry 1920x1080 :0 websockify -D --web=/usr/share/novnc/ --cert=/etc/ssl/novnc.pem 6081 localhost:5900 EOT}resource"docker_container""workspace" {...entrypoint=["sh","-c",replace(coder_agent.main.init_script,"/localhost|127\\.0\\.0\\.1/","host.docker.internal")]env=["CODER_AGENT_TOKEN=${coder_agent.main.token}", ]...} Or actually there are other solutions? |
BetaWas this translation helpful?Give feedback.
All reactions
😄 1