Password generator in rancher catalog entry

We are created several catalog entries with the possibility to generate a password (via environment in rancher-compose.yml) which is pasted directly in the docker-compose.yml. We are using rancher v1.6.14.
The problem is that sometimes a password with a “#” sign is generated and everything behind it is interpreted as a comment. Is there any solution to prevent this?

e.g.
rancher-compose.yml

- variable: “GRAF_ADMINPW”
label: “Grafana Admin Password”
description: “Please insert here the password for administrative Grafana users”
default:
required: true
type: “password”

docker-compose.yml

grafana:
image: grafana/grafana:4.6.3
environment:
GF_ADMIN_PASSWORD: ‘${GRAF_ADMINPW}’

generated Password: Q2a?++3g%O?#+ry%

I can access grafana afterwards only with password Q2a?++3g%O?

greetings Peter