Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for non-ASCII characters in environment variable names #277

Closed
nevergone opened this issue Jun 24, 2022 · 0 comments · Fixed by #378
Closed

Support for non-ASCII characters in environment variable names #277

nevergone opened this issue Jun 24, 2022 · 0 comments · Fixed by #378
Labels
enhancement New feature or request

Comments

@nevergone
Copy link

nevergone commented Jun 24, 2022

Why not allow all characters in variable names when env_file is used? Why not let the system shell handle this if Docker allows it?
Related issue: docker/compose#8862

Docker version 20.10.17, build 100c701

$ docker run --rm -e árvíztűrő-TÜKÖRFÚRÓGÉP=ÁRVÍZTŰRŐ-tükörfúrógép ubuntu env

output:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=18f81a2d4cf5
árvíztűrő-TÜKÖRFÚRÓGÉP=ÁRVÍZTŰRŐ-tükörfúrógép
HOME=/root

docker-compose version 1.29.2, build 5becea4c

docker-compose.yml (environment):

services:
  cli:
    image: ubuntu
    environment:
      árvíztűrő-TÜKÖRFÚRÓGÉP: ÁRVÍZTŰRŐ-tükörfúrógép
    command: env

output:

$ docker-compose up
Creating network "ramdisk_default" with the default driver
Creating ramdisk_cli_1 ... done
Attaching to ramdisk_cli_1
cli_1  | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
cli_1  | HOSTNAME=73fcdcfb0656
cli_1  | árvíztűrő-TÜKÖRFÚRÓGÉP=ÁRVÍZTŰRŐ-tükörfúrógép
cli_1  | HOME=/root
ramdisk_cli_1 exited with code 0

docker-compose.yml (env_file):

services:
  cli:
    image: ubuntu
    env_file:
      - env.test.txt
    command: env

env.test.txt:

árvíztűrő-TÜKÖRFÚRÓGÉP=ÁRVÍZTŰRŐ-tükörfúrógép

output:

$ docker-compose up
Starting ramdisk_cli_1 ... done
Attaching to ramdisk_cli_1
cli_1  | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
cli_1  | HOSTNAME=73fcdcfb0656
cli_1  | árvíztűrő-TÜKÖRFÚRÓGÉP=ÁRVÍZTŰRŐ-tükörfúrógép
cli_1  | HOME=/root
ramdisk_cli_1 exited with code 0

Docker Compose version v2.6.1

docker-compose.yml (environment):

services:
  cli:
    image: ubuntu
    environment:
      árvíztűrő-TÜKÖRFÚRÓGÉP: ÁRVÍZTŰRŐ-tükörfúrógép
    command: env

output:

$ docker-compose up
[+] Running 1/0
 ⠿ Container ramdisk-cli-1  Created                                                                                                                                                      0.1s
Attaching to ramdisk-cli-1
ramdisk-cli-1  | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ramdisk-cli-1  | HOSTNAME=53828dcd3646
ramdisk-cli-1  | árvíztűrő-TÜKÖRFÚRÓGÉP=ÁRVÍZTŰRŐ-tükörfúrógép
ramdisk-cli-1  | HOME=/root
ramdisk-cli-1 exited with code 0

docker-compose.yml (env_file):

services:
  cli:
    image: ubuntu
    env_file:
      - env.test.txt
    command: env

env.test.txt:

árvíztűrő-TÜKÖRFÚRÓGÉP=ÁRVÍZTŰRŐ-tükörfúrógép

output:

$ docker-compose up
unexpected character "¡" in variable name near "árvíztűrő-TÜKÖRFÚRÓGÉP=ÁRVÍZTŰRŐ-tükörfúrógép\n"
@milas milas added the enhancement New feature or request label Sep 26, 2022
@milas milas changed the title compose env_file don't filter variable name Support for non-ASCII characters in environment variable names Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants