I'm trying to use my computer name as part of an address inside a docker file. I have an .env file with where it is supposed to call hostname. If I do an echo to the variable I can get the computer name but I can pass it to "traefik.http.routers.whoami.rule=Host(${HOST_HOSTNAME}.dd.dd.com)"
whoami:
image: containous/whoami
container_name: whoami
restart: ${RESTART}
labels:
- "traefik.enable=true"
# default route over https
- "traefik.http.routers.whoami.rule=Host(`${HOST_HOSTNAME}.dd.dd.com`)"
- "traefik.http.routers.whoami.entrypoints=https"
- "traefik.http.routers.whoami.tls.certresolver=${PROVIDER}"
# HTTP to HTTPS
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
- "traefik.http.routers.whoami-redirs.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.whoami-redirs.entrypoints=http"
- "traefik.http.routers.whoami-redirs.middlewares=redirect-to-https"
Its any other way that I can invoke the computer name and use it to complete the address on the 8 code line?
This is what I've tried inside the .env file.
HOST_HOSTNAME=hostname
HOST_HOSTNAME='hostname'
set host=%COMPUTERNAME%
HOST_HOSTNAME=host