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

[BUG] YAML top-level name linter does not accept env variables #11787

Open
DeanAyalon opened this issue May 2, 2024 · 1 comment
Open

[BUG] YAML top-level name linter does not accept env variables #11787

DeanAyalon opened this issue May 2, 2024 · 1 comment

Comments

@DeanAyalon
Copy link

DeanAyalon commented May 2, 2024

Description

Within the docker-compose.yml

name: ${PROJECT}
services: 

While any other property accepts ${VARIABLES} from .env, the name property shows the error:

String does not match the pattern of "^[a-z0-9][a-z0-9_-]*$".yaml-schema: docker-compose.yml
Source: compose-spec.json

The variable still works, and the containers do open under the project name specified in the .env file - The error is in the linting itself

Steps To Reproduce

Create a .env file with a variable defined for the compose project name

PROJECT=project-name

Create a compose yml with the top-level name property set to a .env variable

name: ${PROJECT}
...

Run the compose
docker compose up

The container will open under the project defined in .env, but the YML file will show the error described above

Compose Version

Docker Compose version v2.26.1-desktop.1

docker-compose version 1.29.2, build 5becea4
docker-py version: 5.0.0
CPython version: 3.7.10
OpenSSL version: OpenSSL 1.1.0l 10 Sep 2019

(Using docker compose)

Docker Environment

Client: Docker Engine - Community
 Version:    26.1.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.13.1-desktop.1
    Path:     /usr/lib/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.26.1-desktop.1
    Path:     /usr/lib/docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container. (Docker Inc.)
    Version:  0.0.27
    Path:     /usr/lib/docker/cli-plugins/docker-debug
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     /usr/lib/docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.23
    Path:     /usr/lib/docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.4
    Path:     /usr/lib/docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.1.0
    Path:     /usr/lib/docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /usr/lib/docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.6.3
    Path:     /usr/lib/docker/cli-plugins/docker-scout

Server:
 Containers: 7
  Running: 2
  Paused: 0
  Stopped: 5
 Images: 60
 Server Version: 26.1.0
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: e377cd56a71523140ca6ae87e30244719194a521
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.8.0-76060800daily20240311-generic
 Operating System: Pop!_OS 22.04 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 31.19GiB
 Name: dean-pop
 ID: abfda37a-4a3a-43c6-9e29-524ea89c51c6
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: jackdeaniels
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
@DeanAyalon
Copy link
Author

My apologies, the enter key simply posted the issue....
Editing the post -_-

DeanAyalon added a commit to DeanAyalon/verdaccio that referenced this issue May 2, 2024
DeanAyalon added a commit to DeanAyalon/verdaccio that referenced this issue May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant