最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Why runing laravel app which using dockersail I got attribute version is obsolete? - Stack Overflow

programmeradmin6浏览0评论

I need on my home laptop to run laravel 8 app which using laravel/sail: ^1.0.1 and running it I got errors:

master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/_MyApps/app$ ./vendor/bin/sail up
Docker is not running.
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/_MyApps/app$ docker compose up
no configuration file provided: not found
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/_MyApps/app$ ./vendor/bin/sail up
Docker is not running.
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/_MyApps/app$ docker compose -f docker-compose.yml logs
open /mnt/_work_sdb8/wwwroot/lar/_MyApps/app/docker-compose.yml: no such file or directory
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/_MyApps/app$ docker compose -f docker/docker-compose.yml logs
WARN[0000] /mnt/_work_sdb8/wwwroot/lar/_MyApps/app/docker/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion

My docker/docker-compose.yml has lines :

version: "3"

networks:
  myapp:

services:
    nginx:
        image: nginx:1.21.0-alpine
        container_name: myapp-nginx
        ports:

    ...

In other tab I check my docker :

root@master-at-home:/home/master/Downloads# sudo systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2025-03-10 13:33:27 EET; 28min ago
TriggeredBy: ● docker.socket
       Docs: 
   Main PID: 55995 (dockerd)
      Tasks: 11
     Memory: 31.9M
        CPU: 1.032s
     CGroup: /system.slice/docker.service
             └─55995 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Mar 10 13:33:26 master-at-home dockerd[55995]: time="2025-03-10T13:33:26.041601402+02:00" level=info msg="OTEL tracing is not configured, using no-op tracer provider"
Mar 10 13:33:26 master-at-home dockerd[55995]: time="2025-03-10T13:33:26.044508941+02:00" level=info msg="detected 127.0.0.53 nameserver, assuming systemd-resolved, so using resolv.conf: /run/systemd/resolve/resolv.conf"
Mar 10 13:33:26 master-at-home dockerd[55995]: time="2025-03-10T13:33:26.440859472+02:00" level=info msg="Loading containers: start."
Mar 10 13:33:27 master-at-home dockerd[55995]: time="2025-03-10T13:33:27.307691203+02:00" level=info msg="Loading containers: done."
Mar 10 13:33:27 master-at-home dockerd[55995]: time="2025-03-10T13:33:27.432270829+02:00" level=info msg="Docker daemon" commit=bbd0a17 containerd-snapshotter=false storage-driver=overlay2 version=28.0.1
Mar 10 13:33:27 master-at-home dockerd[55995]: time="2025-03-10T13:33:27.433207470+02:00" level=info msg="Initializing buildkit"
Mar 10 13:33:27 master-at-home dockerd[55995]: time="2025-03-10T13:33:27.593291442+02:00" level=info msg="Completed buildkit initialization"
Mar 10 13:33:27 master-at-home dockerd[55995]: time="2025-03-10T13:33:27.612976962+02:00" level=info msg="Daemon has completed initialization"
Mar 10 13:33:27 master-at-home dockerd[55995]: time="2025-03-10T13:33:27.613246402+02:00" level=info msg="API listen on /run/docker.sock"
Mar 10 13:33:27 master-at-home systemd[1]: Started Docker Application Container Engine.

I have in my OS :

root@master-at-home:/home/master/Downloads# docker -v
Docker version 28.0.1, build 068a01e
root@master-at-home:/home/master/Downloads# docker composer -v
Docker version 28.0.1, build 068a01e
root@master-at-home:/home/master/Downloads# uname -a
Linux master-at-home 6.8.0-52-generic #53~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jan 15 19:18:46 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Not Sure, is it versions issue ? How to fix it ?

I need on my home laptop to run laravel 8 app which using laravel/sail: ^1.0.1 and running it I got errors:

master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/_MyApps/app$ ./vendor/bin/sail up
Docker is not running.
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/_MyApps/app$ docker compose up
no configuration file provided: not found
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/_MyApps/app$ ./vendor/bin/sail up
Docker is not running.
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/_MyApps/app$ docker compose -f docker-compose.yml logs
open /mnt/_work_sdb8/wwwroot/lar/_MyApps/app/docker-compose.yml: no such file or directory
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/_MyApps/app$ docker compose -f docker/docker-compose.yml logs
WARN[0000] /mnt/_work_sdb8/wwwroot/lar/_MyApps/app/docker/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion

My docker/docker-compose.yml has lines :

version: "3"

networks:
  myapp:

services:
    nginx:
        image: nginx:1.21.0-alpine
        container_name: myapp-nginx
        ports:

    ...

In other tab I check my docker :

root@master-at-home:/home/master/Downloads# sudo systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2025-03-10 13:33:27 EET; 28min ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker
   Main PID: 55995 (dockerd)
      Tasks: 11
     Memory: 31.9M
        CPU: 1.032s
     CGroup: /system.slice/docker.service
             └─55995 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Mar 10 13:33:26 master-at-home dockerd[55995]: time="2025-03-10T13:33:26.041601402+02:00" level=info msg="OTEL tracing is not configured, using no-op tracer provider"
Mar 10 13:33:26 master-at-home dockerd[55995]: time="2025-03-10T13:33:26.044508941+02:00" level=info msg="detected 127.0.0.53 nameserver, assuming systemd-resolved, so using resolv.conf: /run/systemd/resolve/resolv.conf"
Mar 10 13:33:26 master-at-home dockerd[55995]: time="2025-03-10T13:33:26.440859472+02:00" level=info msg="Loading containers: start."
Mar 10 13:33:27 master-at-home dockerd[55995]: time="2025-03-10T13:33:27.307691203+02:00" level=info msg="Loading containers: done."
Mar 10 13:33:27 master-at-home dockerd[55995]: time="2025-03-10T13:33:27.432270829+02:00" level=info msg="Docker daemon" commit=bbd0a17 containerd-snapshotter=false storage-driver=overlay2 version=28.0.1
Mar 10 13:33:27 master-at-home dockerd[55995]: time="2025-03-10T13:33:27.433207470+02:00" level=info msg="Initializing buildkit"
Mar 10 13:33:27 master-at-home dockerd[55995]: time="2025-03-10T13:33:27.593291442+02:00" level=info msg="Completed buildkit initialization"
Mar 10 13:33:27 master-at-home dockerd[55995]: time="2025-03-10T13:33:27.612976962+02:00" level=info msg="Daemon has completed initialization"
Mar 10 13:33:27 master-at-home dockerd[55995]: time="2025-03-10T13:33:27.613246402+02:00" level=info msg="API listen on /run/docker.sock"
Mar 10 13:33:27 master-at-home systemd[1]: Started Docker Application Container Engine.

I have in my OS :

root@master-at-home:/home/master/Downloads# docker -v
Docker version 28.0.1, build 068a01e
root@master-at-home:/home/master/Downloads# docker composer -v
Docker version 28.0.1, build 068a01e
root@master-at-home:/home/master/Downloads# uname -a
Linux master-at-home 6.8.0-52-generic #53~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jan 15 19:18:46 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Not Sure, is it versions issue ? How to fix it ?

Share Improve this question asked Mar 10 at 12:39 mstdmstdmstdmstd 3,23322 gold badges86 silver badges192 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Do nothing and ignore the warning.

Docker added this as a warning to Compose; also see docker/compose#12068. However, the Compose file format still changes regularly, and I find version: useful to document what file format is in use. Since this warning was added Docker added a similar version indicator to Dockerfiles, and meanwhile Compose doesn't warn about settings that are actively obsolete (links:, expose:), unnecessary (container_name:, hostname:, most uses of network:), potentially confusing (build: and image: together), or against best practices (network_mode: host).

If your file is compatible with the standalone Python implementation of the Compose tool (no longer supported by Docker) then I'd continue to label the file with version: '2.4' or version: '3.8', depending on whether you're using the version 2 or version 3 file format. (Note that version: "3" translates to version 3.0 and you probably want something newer; some versions of the Compose documentation referred to a version 3.9 that never existed.)

There isn't a standard format for version: for the moving Compose specification. Docker documents file options in terms of the versions of its implementation of the Compose tool that use it. Since the tool doesn't honor the version: label anyways, for documentation purposes I might use a semantic-version build-metadata tag. For example, if you want a container to restart if its dependency restarts, the corresponding depends_on: syntax was added in version 2.17 of the Compose tool, and I might write version: '4.0+compose-2.17' for this case.

发布评论

评论列表(0)

  1. 暂无评论