compose-cli icon indicating copy to clipboard operation
compose-cli copied to clipboard

env-file not working with ACI context

Open tarrnobi opened this issue 3 years ago • 1 comments

Description

Using the Microsoft Tutorial for testing purposes, I can deploy a local group of containers using the --env-file command for variable substitution, however when I try to do the same with an ACI context, I get the message ACI integration does not support labels in compose applications. The documentation here seems to indicate that the functionality should work.

Steps to reproduce the issue:

  1. docker-compose.yml
version: '3'
services:
  azure-vote-back:
    image: mcr.microsoft.com/oss/bitnami/redis:6.0.8
    container_name: azure-vote-back
    environment:
      ALLOW_EMPTY_PASSWORD: ${ALLOW_EMPTY_PASSWORD}
    ports:
        - "6379:6379"

  azure-vote-front:
    build: ./azure-vote
    image: mcr.microsoft.com/azuredocs/azure-vote-front:v1
    container_name: azure-vote-front
    environment:
      REDIS: azure-vote-back
    ports:
        - "80:80"

2 vars.env

ALLOW_EMPTY_PASSWORD=yes
  1. run docker compose --env-file vars.env up

Describe the results you received: ACI integration does not support labels in compose applications

Describe the results you expected: The container to deploy

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: v1.0.25
 Version:           20.10.16
 API version:       1.41
 Go version:        go1.17.10
 Git commit:        aa7e414
 Built:             Thu May 12 09:17:07 2022
 OS/Arch:           windows/amd64
 Context:           bren-sandbox
 Experimental:      true

Server: Docker Desktop 4.9.1 (81317)
 Engine:
  Version:          20.10.16
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.17.10
  Git commit:       f756502
  Built:            Thu May 12 09:15:42 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.4
  GitCommit:        212e8b6fa2f44b9c21b2798135fc6fb7c53efc16
 runc:
  Version:          1.1.1
  GitCommit:        v1.1.1-0-g52de29d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

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.

bren-sandbox

Output of docker info: Note: I've swapped to default for this section, as the ACI context cannot provide this detail.

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.8.2)
  compose: Docker Compose (Docker Inc., v2.6.0)
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
  scan: Docker Scan (Docker Inc., v0.17.0)

Server:
 Containers: 8
  Running: 0
  Paused: 0
  Stopped: 8
 Images: 30
 Server Version: 20.10.16
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 212e8b6fa2f44b9c21b2798135fc6fb7c53efc16
 runc version: v1.1.1-0-g52de29d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.4.72-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 12.27GiB
 Name: docker-desktop
 ID: JXP5:WVZE:XIDX:EVMT:4YL3:YMVE:R5ES:56QI:ABDC:32UV:Q3Y6:XOHI
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5000
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support

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

tarrnobi avatar Jun 23 '22 13:06 tarrnobi

Same problem here.

sfirke avatar Jul 11 '22 18:07 sfirke

I'm running into the same problem. It seems like docker compose --help shows many options that are not supported by ACI, like -p, --project-name and --env-file

Lhaaits avatar Sep 29 '22 07:09 Lhaaits

Any updates on this issue or is any workaround available to pass environment variables in the ACI context?

soenkefrantz avatar Sep 30 '22 09:09 soenkefrantz

Haven't tried this yet, but it worked in another case:

export $(cat docker/dev/.env | xargs) && docker compose up

You do need to remove any # comments from the .env file

Lhaaits avatar Sep 30 '22 09:09 Lhaaits

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] avatar May 22 '23 00:05 stale[bot]

Still worth fixing if it persists. I gave up on deploying with docker compose and the Azure CLI, too limited - the best workaround for my use case was to deploy with docker compose on an Azure VM and avoid the CLI.

sfirke avatar May 22 '23 02:05 sfirke

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

stale[bot] avatar Jun 18 '23 18:06 stale[bot]

Note to readers that docker-cli is being retired in November 2023.

sfirke avatar Jun 21 '23 15:06 sfirke