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

better handling for default networks #42

Merged
merged 4 commits into from
Aug 14, 2022
Merged

Conversation

acdoussan
Copy link
Contributor

Currently, the default networks are either placed in the networks object, or filtered out in the case of "bridge".

docker compose does not support default networks in the "networks" object. Ref: docker/compose#3012

This change updates the code to filter out all default networks, and if there are no networks when the networks object is being created, it grabs the first network from the list of networks, sets "network-mode" on the values, and removes the network object from the generated compose file.

Couple of examples:

Before change:

version: "3"
services:
  uptime-kuma:
    cap_add:
      - AUDIT_WRITE
      - CHOWN
      - DAC_OVERRIDE
      - FOWNER
      - FSETID
      - KILL
      - MKNOD
      - NET_BIND_SERVICE
      - NET_RAW
      - SETFCAP
      - SETGID
      - SETPCAP
      - SETUID
      - SYS_CHROOT
    cap_drop:
      - AUDIT_CONTROL
      - BLOCK_SUSPEND
      - DAC_READ_SEARCH
      - IPC_LOCK
      - IPC_OWNER
      - LEASE
      - LINUX_IMMUTABLE
      - MAC_ADMIN
      - MAC_OVERRIDE
      - NET_ADMIN
      - NET_BROADCAST
      - SYSLOG
      - SYS_ADMIN
      - SYS_BOOT
      - SYS_MODULE
      - SYS_NICE
      - SYS_PACCT
      - SYS_PTRACE
      - SYS_RAWIO
      - SYS_RESOURCE
      - SYS_TIME
      - SYS_TTY_CONFIG
      - WAKE_ALARM
    command:
      - node
      - server/server.js
    container_name: uptime-kuma
    entrypoint:
      - /usr/bin/dumb-init
      - --
      - extra/entrypoint.sh
    environment:
      - NODE_VERSION=16.15.0
      - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
      - YARN_VERSION=1.22.18
    hostname: 37924a2a5be5
    image: louislam/uptime-kuma:1
    ipc: private
    logging:
      driver: json-file
      options: {}
    ports:
      - 3001:3001/tcp
    restart: always
    volumes:
      - uptime-kuma:/app/data
    working_dir: /app
networks: {}
volumes:
  uptime-kuma:
    external: true

After change:

version: "3"
services:
  uptime-kuma:
    cap_add:
      - AUDIT_WRITE
      - CHOWN
      - DAC_OVERRIDE
      - FOWNER
      - FSETID
      - KILL
      - MKNOD
      - NET_BIND_SERVICE
      - NET_RAW
      - SETFCAP
      - SETGID
      - SETPCAP
      - SETUID
      - SYS_CHROOT
    cap_drop:
      - AUDIT_CONTROL
      - BLOCK_SUSPEND
      - DAC_READ_SEARCH
      - IPC_LOCK
      - IPC_OWNER
      - LEASE
      - LINUX_IMMUTABLE
      - MAC_ADMIN
      - MAC_OVERRIDE
      - NET_ADMIN
      - NET_BROADCAST
      - SYSLOG
      - SYS_ADMIN
      - SYS_BOOT
      - SYS_MODULE
      - SYS_NICE
      - SYS_PACCT
      - SYS_PTRACE
      - SYS_RAWIO
      - SYS_RESOURCE
      - SYS_TIME
      - SYS_TTY_CONFIG
      - WAKE_ALARM
    command:
      - node
      - server/server.js
    container_name: uptime-kuma
    entrypoint:
      - /usr/bin/dumb-init
      - --
      - extra/entrypoint.sh
    environment:
      - NODE_VERSION=16.15.0
      - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
      - YARN_VERSION=1.22.18
    hostname: 37924a2a5be5
    image: louislam/uptime-kuma:1
    ipc: private
    logging:
      driver: json-file
      options: {}
    mac_address: 02:42:ac:11:00:04
    network_mode: bridge
    ports:
      - 3001:3001/tcp
    restart: always
    volumes:
      - uptime-kuma:/app/data
    working_dir: /app
volumes:
  uptime-kuma:
    external: true

Before change:

version: "3"
services:
  guacamole:
    cap_add:
      - AUDIT_WRITE
      - CHOWN
      - DAC_OVERRIDE
      - FOWNER
      - FSETID
      - KILL
      - MKNOD
      - NET_BIND_SERVICE
      - NET_RAW
      - SETFCAP
      - SETGID
      - SETPCAP
      - SETUID
      - SYS_CHROOT
    cap_drop:
      - AUDIT_CONTROL
      - BLOCK_SUSPEND
      - DAC_READ_SEARCH
      - IPC_LOCK
      - IPC_OWNER
      - LEASE
      - LINUX_IMMUTABLE
      - MAC_ADMIN
      - MAC_OVERRIDE
      - NET_ADMIN
      - NET_BROADCAST
      - SYSLOG
      - SYS_ADMIN
      - SYS_BOOT
      - SYS_MODULE
      - SYS_NICE
      - SYS_PACCT
      - SYS_PTRACE
      - SYS_RAWIO
      - SYS_RESOURCE
      - SYS_TIME
      - SYS_TTY_CONFIG
      - WAKE_ALARM
    container_name: guacamole
    entrypoint:
      - /init
    environment:
      - PATH=/usr/lib/postgresql/11/bin:/usr/local/tomcat/bin:/usr/local/openjdk-15/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
      - JAVA_HOME=/usr/local/openjdk-15
      - LANG=C.UTF-8
      - JAVA_VERSION=15.0.2
      - CATALINA_HOME=/usr/local/tomcat
      - TOMCAT_NATIVE_LIBDIR=/usr/local/tomcat/native-jni-lib
      - LD_LIBRARY_PATH=/usr/local/tomcat/native-jni-lib
      - TOMCAT_MAJOR=9
      - TOMCAT_VERSION=9.0.43
      - APPLICATION=guacamole
      - BUILD_RFC3339=2021-02-15T11:14:14Z
      - REVISION=b467f1a
      - 'DESCRIPTION=A Docker Container for Apache Guacamole, a client-less remote
        desktop gateway. It supports standard protocols like VNC, RDP, and SSH over
        HTML5. For x64 and arm64.'
      - PACKAGE=maxwaldorf/guacamole
      - VERSION=v1.3.1-2-gb467f1a
      - ARCH=amd64
      - GUAC_VER=1.3.0
      - GUACAMOLE_HOME=/config/guacamole
      - PG_MAJOR=11
      - PGDATA=/config/postgres
    hostname: 588cc8c86233
    image: maxwaldorf/guacamole:latest
    ipc: private
    labels:
      org.opencontainers.image.authors: MaxWaldorf,OZNU
      org.opencontainers.image.created: '2021-02-15T11:14:14Z'
      org.opencontainers.image.description: 'A Docker Container for Apache Guacamole,
        a client-less remote desktop gateway. It supports standard protocols like
        VNC, RDP, and SSH over HTML5. For x64 and arm64.'
      org.opencontainers.image.documentation: https://github.com/maxwaldorf/guacamole/README.md
      org.opencontainers.image.licenses: GPLv3
      org.opencontainers.image.ref.name: maxwaldorf/guacamole
      org.opencontainers.image.revision: b467f1a
      org.opencontainers.image.source: https://github.com/maxwaldorf/guacamole
      org.opencontainers.image.title: guacamole
      org.opencontainers.image.url: https://hub.docker.com/r/maxwaldorf/guacamole/
      org.opencontainers.image.version: v1.3.1-2-gb467f1a
    logging:
      driver: json-file
      options: {}
    networks:
      - host
    ports:
      - 8080:8080/tcp
    restart: always
    volumes:
      - guacamole:/config
    working_dir: /config
networks:
  host:
    external: true
    name: host
volumes:
  guacamole:
    external: true

After change:

version: "3"
services:
  guacamole:
    cap_add:
      - AUDIT_WRITE
      - CHOWN
      - DAC_OVERRIDE
      - FOWNER
      - FSETID
      - KILL
      - MKNOD
      - NET_BIND_SERVICE
      - NET_RAW
      - SETFCAP
      - SETGID
      - SETPCAP
      - SETUID
      - SYS_CHROOT
    cap_drop:
      - AUDIT_CONTROL
      - BLOCK_SUSPEND
      - DAC_READ_SEARCH
      - IPC_LOCK
      - IPC_OWNER
      - LEASE
      - LINUX_IMMUTABLE
      - MAC_ADMIN
      - MAC_OVERRIDE
      - NET_ADMIN
      - NET_BROADCAST
      - SYSLOG
      - SYS_ADMIN
      - SYS_BOOT
      - SYS_MODULE
      - SYS_NICE
      - SYS_PACCT
      - SYS_PTRACE
      - SYS_RAWIO
      - SYS_RESOURCE
      - SYS_TIME
      - SYS_TTY_CONFIG
      - WAKE_ALARM
    container_name: guacamole
    entrypoint:
      - /init
    environment:
      - PATH=/usr/lib/postgresql/11/bin:/usr/local/tomcat/bin:/usr/local/openjdk-15/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
      - JAVA_HOME=/usr/local/openjdk-15
      - LANG=C.UTF-8
      - JAVA_VERSION=15.0.2
      - CATALINA_HOME=/usr/local/tomcat
      - TOMCAT_NATIVE_LIBDIR=/usr/local/tomcat/native-jni-lib
      - LD_LIBRARY_PATH=/usr/local/tomcat/native-jni-lib
      - TOMCAT_MAJOR=9
      - TOMCAT_VERSION=9.0.43
      - APPLICATION=guacamole
      - BUILD_RFC3339=2021-02-15T11:14:14Z
      - REVISION=b467f1a
      - 'DESCRIPTION=A Docker Container for Apache Guacamole, a client-less remote
        desktop gateway. It supports standard protocols like VNC, RDP, and SSH over
        HTML5. For x64 and arm64.'
      - PACKAGE=maxwaldorf/guacamole
      - VERSION=v1.3.1-2-gb467f1a
      - ARCH=amd64
      - GUAC_VER=1.3.0
      - GUACAMOLE_HOME=/config/guacamole
      - PG_MAJOR=11
      - PGDATA=/config/postgres
    hostname: 588cc8c86233
    image: maxwaldorf/guacamole:latest
    ipc: private
    labels:
      org.opencontainers.image.authors: MaxWaldorf,OZNU
      org.opencontainers.image.created: '2021-02-15T11:14:14Z'
      org.opencontainers.image.description: 'A Docker Container for Apache Guacamole,
        a client-less remote desktop gateway. It supports standard protocols like
        VNC, RDP, and SSH over HTML5. For x64 and arm64.'
      org.opencontainers.image.documentation: https://github.com/maxwaldorf/guacamole/README.md
      org.opencontainers.image.licenses: GPLv3
      org.opencontainers.image.ref.name: maxwaldorf/guacamole
      org.opencontainers.image.revision: b467f1a
      org.opencontainers.image.source: https://github.com/maxwaldorf/guacamole
      org.opencontainers.image.title: guacamole
      org.opencontainers.image.url: https://hub.docker.com/r/maxwaldorf/guacamole/
      org.opencontainers.image.version: v1.3.1-2-gb467f1a
    logging:
      driver: json-file
      options: {}
    network_mode: host
    ports:
      - 8080:8080/tcp
    restart: always
    volumes:
      - guacamole:/config
    working_dir: /config
volumes:
  guacamole:
    external: true

@acdoussan acdoussan marked this pull request as ready for review August 14, 2022 17:21
@acdoussan
Copy link
Contributor Author

ref: #39

@acdoussan
Copy link
Contributor Author

added fix for #43

@acdoussan
Copy link
Contributor Author

Also added a fix that should resolve #17 (comment), as well as probably #44

docker inspect:

[
    {
        "Id": "3baba09ac88ed1737e5b348e929955ceadb3ad1559b0657166b014cce1da15a0",
        "Created": "2022-08-13T20:09:21.929990889Z",
        "Path": "/usr/bin/dumb-init",
        "Args": [
            "--",
            "extra/entrypoint.sh",
            "node",
            "server/server.js"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 697,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2022-08-14T17:26:17.819681604Z",
            "FinishedAt": "2022-08-14T17:25:40.453265724Z",
            "Health": {
                "Status": "healthy",
                "FailingStreak": 0,
                "Log": [
                    {
                        "Start": "2022-08-14T18:47:10.168013022Z",
                        "End": "2022-08-14T18:47:11.441587605Z",
                        "ExitCode": 0,
                        "Output": "Health Check OK [Res Code: 302]\n"
                    },
                    {
                        "Start": "2022-08-14T18:48:11.472343606Z",
                        "End": "2022-08-14T18:48:12.87121387Z",
                        "ExitCode": 0,
                        "Output": "Health Check OK [Res Code: 302]\n"
                    },
                    {
                        "Start": "2022-08-14T18:49:12.924233062Z",
                        "End": "2022-08-14T18:49:14.037362738Z",
                        "ExitCode": 0,
                        "Output": "Health Check OK [Res Code: 302]\n"
                    },
                    {
                        "Start": "2022-08-14T18:50:14.081606281Z",
                        "End": "2022-08-14T18:50:15.675979577Z",
                        "ExitCode": 0,
                        "Output": "Health Check OK [Res Code: 302]\n"
                    },
                    {
                        "Start": "2022-08-14T18:51:15.714774206Z",
                        "End": "2022-08-14T18:51:17.438251089Z",
                        "ExitCode": 0,
                        "Output": "Health Check OK [Res Code: 302]\n"
                    }
                ]
            }
        },
        "Image": "sha256:4495e097b5fa4528ec92dc855bb11775ea548cceda223c1021fb3b1f7f1ab8ea",
        "ResolvConfPath": "/var/lib/docker/containers/3baba09ac88ed1737e5b348e929955ceadb3ad1559b0657166b014cce1da15a0/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/3baba09ac88ed1737e5b348e929955ceadb3ad1559b0657166b014cce1da15a0/hostname",
        "HostsPath": "/var/lib/docker/containers/3baba09ac88ed1737e5b348e929955ceadb3ad1559b0657166b014cce1da15a0/hosts",
        "LogPath": "/var/lib/docker/containers/3baba09ac88ed1737e5b348e929955ceadb3ad1559b0657166b014cce1da15a0/3baba09ac88ed1737e5b348e929955ceadb3ad1559b0657166b014cce1da15a0-json.log",
        "Name": "/uptime-kuma",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "docker-default",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "tmp_default",
            "PortBindings": {
                "3001/tcp": [
                    {
                        "HostIp": "",
                        "HostPort": "3001"
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "always",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": [
                "AUDIT_WRITE",
                "CHOWN",
                "DAC_OVERRIDE",
                "FOWNER",
                "FSETID",
                "KILL",
                "MKNOD",
                "NET_BIND_SERVICE",
                "NET_RAW",
                "SETFCAP",
                "SETGID",
                "SETPCAP",
                "SETUID",
                "SYS_CHROOT"
            ],
            "CapDrop": [
                "AUDIT_CONTROL",
                "BLOCK_SUSPEND",
                "DAC_READ_SEARCH",
                "IPC_LOCK",
                "IPC_OWNER",
                "LEASE",
                "LINUX_IMMUTABLE",
                "MAC_ADMIN",
                "MAC_OVERRIDE",
                "NET_ADMIN",
                "NET_BROADCAST",
                "SYSLOG",
                "SYS_ADMIN",
                "SYS_BOOT",
                "SYS_MODULE",
                "SYS_NICE",
                "SYS_PACCT",
                "SYS_PTRACE",
                "SYS_RAWIO",
                "SYS_RESOURCE",
                "SYS_TIME",
                "SYS_TTY_CONFIG",
                "WAKE_ALARM"
            ],
            "CgroupnsMode": "private",
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": [],
            "GroupAdd": null,
            "IpcMode": "private",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "DeviceCgroupRules": null,
            "DeviceRequests": null,
            "KernelMemory": 0,
            "KernelMemoryTCP": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": null,
            "PidsLimit": null,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "Mounts": [
                {
                    "Type": "volume",
                    "Source": "uptime-kuma",
                    "Target": "/app/data",
                    "VolumeOptions": {}
                }
            ],
            "MaskedPaths": [
                "/proc/asound",
                "/proc/acpi",
                "/proc/kcore",
                "/proc/keys",
                "/proc/latency_stats",
                "/proc/timer_list",
                "/proc/timer_stats",
                "/proc/sched_debug",
                "/proc/scsi",
                "/sys/firmware"
            ],
            "ReadonlyPaths": [
                "/proc/bus",
                "/proc/fs",
                "/proc/irq",
                "/proc/sys",
                "/proc/sysrq-trigger"
            ]
        },
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/0a204572f360ed28db80d7177f0c40abd43e42c1604f030a1825c61fe14d31f7-init/diff:/var/lib/docker/overlay2/33aa8acd39218b0c3a1c2d4355c76fdd579972ecffd7a2bccf08cb02395d1576/diff:/var/lib/docker/overlay2/745cf4a8ac27fbb833b22f92b5bd7d635a7acf22ed308771069b16ee0bce1b9c/diff:/var/lib/docker/overlay2/5f62d181199d1e74b991aee81bad653d5e256e7af22692cda66301edf3a225a0/diff:/var/lib/docker/overlay2/05486c43e209e9607908874044fbab20a90304a9e8fc86219856d9e112eea95f/diff:/var/lib/docker/overlay2/96a39dfacc2088c28cd552d525977227c2d8cfeb7764330542722d708312ab58/diff:/var/lib/docker/overlay2/0cbd9bb3f62e37c4c1d14b06fcf4d354dcb7b6c5f41df19f6df0cd61e2809d9c/diff:/var/lib/docker/overlay2/d6d0e1597271da08595e382b2c196f04cab9d2c1f190d2350e648b1b25b4a5df/diff:/var/lib/docker/overlay2/be4a65d8c7e43319b16083daaa99aa127afe5ef18b689073574b868e121f11a8/diff:/var/lib/docker/overlay2/d8f8ce7a3390aff007667c984d8540eb56e0d4b99c8f989e74780af906222c4b/diff:/var/lib/docker/overlay2/edb73c627b29571ccd948c0c953645fb0efa3142cec76a4161c975fdfbc8af6f/diff",
                "MergedDir": "/var/lib/docker/overlay2/0a204572f360ed28db80d7177f0c40abd43e42c1604f030a1825c61fe14d31f7/merged",
                "UpperDir": "/var/lib/docker/overlay2/0a204572f360ed28db80d7177f0c40abd43e42c1604f030a1825c61fe14d31f7/diff",
                "WorkDir": "/var/lib/docker/overlay2/0a204572f360ed28db80d7177f0c40abd43e42c1604f030a1825c61fe14d31f7/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [
            {
                "Type": "volume",
                "Name": "uptime-kuma",
                "Source": "/var/lib/docker/volumes/uptime-kuma/_data",
                "Destination": "/app/data",
                "Driver": "local",
                "Mode": "z",
                "RW": true,
                "Propagation": ""
            }
        ],
        "Config": {
            "Hostname": "37924a2a5be5",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": true,
            "AttachStderr": true,
            "ExposedPorts": {
                "3001/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "NODE_VERSION=16.15.0",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "YARN_VERSION=1.22.18"
            ],
            "Cmd": [
                "node",
                "server/server.js"
            ],
            "Healthcheck": {
                "Test": [
                    "CMD-SHELL",
                    "node extra/healthcheck.js"
                ],
                "Interval": 60000000000,
                "Timeout": 30000000000,
                "StartPeriod": 180000000000,
                "Retries": 5
            },
            "Image": "louislam/uptime-kuma:1",
            "Volumes": {
                "/app/data": {}
            },
            "WorkingDir": "/app",
            "Entrypoint": [
                "/usr/bin/dumb-init",
                "--",
                "extra/entrypoint.sh"
            ],
            "OnBuild": null,
            "Labels": {
                "com.docker.compose.config-hash": "9aba6618fe76eb294405dad39bbd67ab96e8e6c51a5a2e9582e030a5a7b2eeb7",
                "com.docker.compose.container-number": "1",
                "com.docker.compose.depends_on": "",
                "com.docker.compose.oneoff": "False",
                "com.docker.compose.project": "tmp",
                "com.docker.compose.project.config_files": "/tmp/uptime-kuma.compose.yml",
                "com.docker.compose.project.working_dir": "/tmp",
                "com.docker.compose.service": "uptime-kuma",
                "com.docker.compose.version": "2.6.0"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "b162d5a7a578f6bb063867b9fafb59b4c0ff90ea1436f9a19af9a4222bfacfbd",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "3001/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "3001"
                    },
                    {
                        "HostIp": "::",
                        "HostPort": "3001"
                    }
                ]
            },
            "SandboxKey": "/var/run/docker/netns/b162d5a7a578",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "f1aa99448c9e531ac1fc8eb36dc81e287459848ae1d327b5269821b0aa7ea80d",
            "Gateway": "172.17.0.1",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "172.17.0.4",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "MacAddress": "02:42:ac:11:00:04",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "4eab24031a73404ae90962ef135f3192a2fb97d7edef6d7e14d0f4c4f72999ef",
                    "EndpointID": "f1aa99448c9e531ac1fc8eb36dc81e287459848ae1d327b5269821b0aa7ea80d",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.4",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:11:00:04",
                    "DriverOpts": null
                }
            }
        }
    }
]

before change:

version: "3"
services:
  uptime-kuma:
    cap_add:
      - AUDIT_WRITE
      - CHOWN
      - DAC_OVERRIDE
      - FOWNER
      - FSETID
      - KILL
      - MKNOD
      - NET_BIND_SERVICE
      - NET_RAW
      - SETFCAP
      - SETGID
      - SETPCAP
      - SETUID
      - SYS_CHROOT
    cap_drop:
      - AUDIT_CONTROL
      - BLOCK_SUSPEND
      - DAC_READ_SEARCH
      - IPC_LOCK
      - IPC_OWNER
      - LEASE
      - LINUX_IMMUTABLE
      - MAC_ADMIN
      - MAC_OVERRIDE
      - NET_ADMIN
      - NET_BROADCAST
      - SYSLOG
      - SYS_ADMIN
      - SYS_BOOT
      - SYS_MODULE
      - SYS_NICE
      - SYS_PACCT
      - SYS_PTRACE
      - SYS_RAWIO
      - SYS_RESOURCE
      - SYS_TIME
      - SYS_TTY_CONFIG
      - WAKE_ALARM
    command:
      - node
      - server/server.js
    container_name: uptime-kuma
    entrypoint:
      - /usr/bin/dumb-init
      - --
      - extra/entrypoint.sh
    environment:
      - NODE_VERSION=16.15.0
      - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
      - YARN_VERSION=1.22.18
    hostname: 37924a2a5be5
    image: louislam/uptime-kuma:1
    ipc: private
    labels:
      com.docker.compose.config-hash: 9aba6618fe76eb294405dad39bbd67ab96e8e6c51a5a2e9582e030a5a7b2eeb7
      com.docker.compose.container-number: 1
      com.docker.compose.depends_on: ""
      com.docker.compose.oneoff: False
      com.docker.compose.project: tmp
      com.docker.compose.project.config_files: /tmp/uptime-kuma.compose.yml
      com.docker.compose.project.working_dir: /tmp
      com.docker.compose.service: uptime-kuma
      com.docker.compose.version: 2.6.0
    logging:
      driver: json-file
      options: {}
    mac_address: 02:42:ac:11:00:04
    network_mode: bridge
    ports:
      - 3001:3001/tcp
    restart: always
    volumes:
      - uptime-kuma:/app/data
    working_dir: /app
volumes: {}

after change

version: "3"
services:
  uptime-kuma:
    cap_add:
      - AUDIT_WRITE
      - CHOWN
      - DAC_OVERRIDE
      - FOWNER
      - FSETID
      - KILL
      - MKNOD
      - NET_BIND_SERVICE
      - NET_RAW
      - SETFCAP
      - SETGID
      - SETPCAP
      - SETUID
      - SYS_CHROOT
    cap_drop:
      - AUDIT_CONTROL
      - BLOCK_SUSPEND
      - DAC_READ_SEARCH
      - IPC_LOCK
      - IPC_OWNER
      - LEASE
      - LINUX_IMMUTABLE
      - MAC_ADMIN
      - MAC_OVERRIDE
      - NET_ADMIN
      - NET_BROADCAST
      - SYSLOG
      - SYS_ADMIN
      - SYS_BOOT
      - SYS_MODULE
      - SYS_NICE
      - SYS_PACCT
      - SYS_PTRACE
      - SYS_RAWIO
      - SYS_RESOURCE
      - SYS_TIME
      - SYS_TTY_CONFIG
      - WAKE_ALARM
    command:
      - node
      - server/server.js
    container_name: uptime-kuma
    entrypoint:
      - /usr/bin/dumb-init
      - --
      - extra/entrypoint.sh
    environment:
      - NODE_VERSION=16.15.0
      - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
      - YARN_VERSION=1.22.18
    hostname: 37924a2a5be5
    image: louislam/uptime-kuma:1
    ipc: private
    labels:
      com.docker.compose.config-hash: 9aba6618fe76eb294405dad39bbd67ab96e8e6c51a5a2e9582e030a5a7b2eeb7
      com.docker.compose.container-number: 1
      com.docker.compose.depends_on: ""
      com.docker.compose.oneoff: False
      com.docker.compose.project: tmp
      com.docker.compose.project.config_files: /tmp/uptime-kuma.compose.yml
      com.docker.compose.project.working_dir: /tmp
      com.docker.compose.service: uptime-kuma
      com.docker.compose.version: 2.6.0
    logging:
      driver: json-file
      options: {}
    mac_address: 02:42:ac:11:00:04
    network_mode: bridge
    ports:
      - 3001:3001/tcp
    restart: always
    volumes:
      - uptime-kuma:/app/data
    working_dir: /app
volumes:
  uptime-kuma:
    external: true

also verified this still works with the old container that has data in the binds section.

@Red5d Red5d merged commit 357fef9 into Red5d:master Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants