docker-archive / compose-cli

Easily run your Compose application to the cloud with compose-cli
Apache License 2.0
958 stars 254 forks source link

Unable to create hexadecimal environment variable with ECS #2123

Closed nobiit closed 1 year ago

nobiit commented 2 years ago

Description

Steps to reproduce the issue:

  1. Create an ECS context
    docker context create ecs --from-env ${ECS_PROJECT}
    docker context use ${ECS_PROJECT}
  2. Create file ecs-compose.yml with content
    version: "3.8"
    services:
    test:
    image: alpine
    command: env
    environment:
      ENV_NAME: "0x0123456789ABCDEF"
  3. Apply ecs-compose.yml
    docker compose --project-name ${ECS_PROJECT} --file ecs-compose.yml up
  4. Check value of environment ENV_NAME
    aws ecs describe-task-definition --task-definition ${ECS_PROJECT}-test:1 | grep ENV_NAME -A 1

Describe the results you received: ENV_NAME=81985529216486900

Describe the results you expected: ENV_NAME=0x0123456789ABCDEF

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker-compose --version:

docker-compose version 1.29.2, build 5becea4c

Output of docker version:

Client:
 Cloud integration: 1.0.17
 Version:           20.10.11+azure-3
 API version:       1.41
 Go version:        go1.16.12
 Git commit:        dea9396e184290f638ea873c76db7c80efd5a1d2
 Built:             Wed Nov 17 23:49:46 2021
 OS/Arch:           linux/amd64
 Context:           aws-ecs-dev
 Experimental:      true

Server:
 Engine:
  Version:          20.10.11+azure-3
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.12
  Git commit:       847da184ad5048b27f5bdf9d53d070f731b43180
  Built:            Thu Nov 18 00:21:59 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.12+azure-1
  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc:
  Version:          1.0.3
  GitCommit:        f46b6ba2c9314cfc8caae24a32ec5fe9ef1059fe
 docker-init:
  Version:          0.19.0
  GitCommit:        

Output of docker context show:
You can also run docker context inspect context-name to give us more details but don't forget to remove sensitive content.

[
    {
        "Name": "aws-ecs-dev",
        "Metadata": {
            "Description": "credentials read from environment",
            "Type": "ecs"
        },
        "Endpoints": {
            "docker": {
                "SkipTLSVerify": false
            },
            "ecs": {
                "CredentialsFromEnv": true
            }
        },
        "TLSMaterial": {},
        "Storage": {
            "MetadataPath": "/home/codespace/.docker/contexts/meta/75d7905ea8dcb3e4871c3a672258b7fc90bd6dfd64db587052f2e50a744f31c0",
            "TLSPath": "/home/codespace/.docker/contexts/tls/75d7905ea8dcb3e4871c3a672258b7fc90bd6dfd64db587052f2e50a744f31c0"
        }
    }
]

Output of docker info:

Command "info" not available in current context (aws-ecs-dev), you can use the "default" context to run this command

Additional environment details (AWS ECS, Azure ACI, local, etc.):

nobiit commented 2 years ago

It works with default docker-compose

Starting drapia-backend_test_1 ... done
Attaching to drapia-backend_test_1
test_1  | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
test_1  | HOSTNAME=2c013ec20817
test_1  | DMV_TOKEN=0xCC01d7a209576cB3FeA90F52D0E6599C014F01f3
test_1  | HOME=/root
drapia-backend_test_1 exited with code 0
nobiit commented 2 years ago

I tried but failed:

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

keijinamba commented 2 years ago

same

stale[bot] commented 2 years ago

This issue has been automatically marked as not stale anymore due to the recent activity.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 1 year ago

This issue has been automatically closed because it had not recent activity during the stale period.