Specify Running Container on Backup Page from Env Vars in yml file

Thanks but having a platform dependent command line utility in the plugin to get the information does not work (as required) for me (getting the docker id from the command below, does not work on our Ubuntu 18.04 setup):

# cat /proc/self/cgroup|grep "systemd:/docker"| awk -F/ '{print $3}'|cut -c1-12

#. (no results)

even this yields no fruit:

# cat /proc/self/cgroup|grep "systemd:/docker"

#  (no results)

FYI (from docker ps):

CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS                  PORTS                               NAMES
63c52bc571b5        local_discourse/socket-only     "/sbin/boot"             28 minutes ago      Up 28 minutes                                               socket-only
631fbabedda9        local_discourse/socket-only2    "/sbin/boot"             26 hours ago        Up 26 hours                                                 socket-only2
123743e12208        mysql/mysql-server              "/entrypoint.sh mysq…"   2 days ago          Up 20 hours (healthy)   33060/tcp, 0.0.0.0:6603->3306/tcp   mysql-man
7a145366268c        registry.unix.com/unix:condor   "/run.sh"                6 days ago          Up 20 hours             3306/tcp, 0.0.0.0:8999->80/tcp      unix
3cc0c90c3e3a        registry:2                      "/entrypoint.sh /etc…"   7 days ago          Up 7 days               0.0.0.0:5000->5000/tcp              hubby
ca7b55fc5a0c        local_discourse/data            "/sbin/boot"             2 weeks ago         Up 8 days                                                   data

This means that the info (the string which specifies the running container name) should derive from an environmental var in the yml file. to insure the information is platform neutral and can work when many containers are running.

For example, we run multiple Discourse app and other containers at the same time and so using docker-cli commands will not provide the exact info we need (the name of the running container on the web “at the time” which is determined by the reverse proxy configuration, not docker)

We select which container to display by changing the name of the unix socket (or the exposed container port) in the reverse proxy configuration, so we change containers in less than a second with zero downtime. This means the name of the container should (must) come from an env var in the yml file to be 100% reliable and accurate.

Hence, my requirement for the string (name of container, container id, etc.) to only come from environmental variables in the yml file.

For anyone who prefers the container id , they could add that to their env var like this (for example):

DISCOURSE_APP_CONTAINER_NAME = 'socket-only (63c52bc571b5)'

or even:

DISCOURSE_APP_CONTAINER_NAME = '63c52bc571b5'
DISCOURSE_DATA_CONTAINER_NAME = 'ca7b55fc5a0c'

and per my original post (the way we want to use it):

DISCOURSE_APP_CONTAINER_NAME = 'socket-only'
DISCOURSE_DATA_CONTAINER_NAME = 'data'

Which string (token) identifier (name, container id, or both) to use would be based on the requirements of the sys admin (or business).

This is why I was specific to specify that the information must be hardcoded into the main app yml file as an env var (not from CLI commands like docker ps or other OS (platform) dependent commands).

Hope that makes my requirement more clear.

I want to this to be platform and configuration neutral and not dependent on CLI commands or system commands. We run Docker for many other apps and not only Discourse on our servers (including Discourse, Dockerized LAMP apps, Docker private registries and more, as you can see from a sample docker ps output above.).