diff mbox series

[v2,2/4] package/docker-engine: bump version to v23.0.0

Message ID 20230203034443.326513-2-christian@paral.in
State Superseded, archived
Headers show
Series [v2,1/4] package/containerd: bump to version 1.6.16 | expand

Commit Message

Christian Stewart Feb. 3, 2023, 3:44 a.m. UTC
This update requires a workaround for the non-standard vendor/ structure in the
docker-engine repository, which has an invalid vendor/modules.txt file.

Removing the vendor/modules.txt file fixes the build error.

Reference: https://github.com/moby/moby/issues/44618#issuecomment-1343565705

The go download post-process script uses go mod init to create the go.mod file
which specifies a language version of go1.16 on default. Use go mod edit to
adjust the go.mod file to the required minimum version go1.19 for generic types
used by docker-engine. (Fixes a build error). Note that this changes the go.mod
language version and is not required to be equal to the current Go tool version.

Note that as of v23.0.0 docker-engine expects containerd to be started by
systemd if --containerd= flag is set in dockerd.service, whereas in previous
versions containerd was started by the docker daemon as a sub-process.

There is no sysv unit for containerd, but this is OK: in the Docker sysv init
file S60dockerd, we do not set the --containerd flag. The docker daemon will
start containerd as a sub-process automatically due to the absence of this flag.

Signed-off-by: Christian Stewart <christian@paral.in>

---

v1 -> v2:

 - clarify commit message about containerd.service and sysv compat
 - fix formatting in S60dockerd
 - bundle commit into a series with required containerd changes

Signed-off-by: Christian Stewart <christian@paral.in>
---
 package/docker-engine/S60dockerd         |  2 +-
 package/docker-engine/docker-engine.hash |  2 +-
 package/docker-engine/docker-engine.mk   | 16 +++++++++++++++-
 3 files changed, 17 insertions(+), 3 deletions(-)

Comments

Yann E. MORIN Feb. 4, 2023, 12:56 p.m. UTC | #1
Christian, All,

On 2023-02-02 19:44 -0800, Christian Stewart via buildroot spake thusly:
> This update requires a workaround for the non-standard vendor/ structure in the
> docker-engine repository, which has an invalid vendor/modules.txt file.
> 
> Removing the vendor/modules.txt file fixes the build error.
> 
> Reference: https://github.com/moby/moby/issues/44618#issuecomment-1343565705
> 
> The go download post-process script uses go mod init to create the go.mod file
> which specifies a language version of go1.16 on default. Use go mod edit to
> adjust the go.mod file to the required minimum version go1.19 for generic types
> used by docker-engine. (Fixes a build error). Note that this changes the go.mod
> language version and is not required to be equal to the current Go tool version.
> 
> Note that as of v23.0.0 docker-engine expects containerd to be started by
> systemd if --containerd= flag is set in dockerd.service, whereas in previous
> versions containerd was started by the docker daemon as a sub-process.
> 
> There is no sysv unit for containerd, but this is OK: in the Docker sysv init
> file S60dockerd, we do not set the --containerd flag. The docker daemon will
> start containerd as a sub-process automatically due to the absence of this flag.
> 
> Signed-off-by: Christian Stewart <christian@paral.in>
> 
> ---
> 
> v1 -> v2:
> 
>  - clarify commit message about containerd.service and sysv compat
>  - fix formatting in S60dockerd
>  - bundle commit into a series with required containerd changes
> 
> Signed-off-by: Christian Stewart <christian@paral.in>
> ---
>  package/docker-engine/S60dockerd         |  2 +-
>  package/docker-engine/docker-engine.hash |  2 +-
>  package/docker-engine/docker-engine.mk   | 16 +++++++++++++++-
>  3 files changed, 17 insertions(+), 3 deletions(-)
> 
> diff --git a/package/docker-engine/S60dockerd b/package/docker-engine/S60dockerd
> index def8bea149..7591f9fe66 100644
> --- a/package/docker-engine/S60dockerd
> +++ b/package/docker-engine/S60dockerd
> @@ -10,7 +10,7 @@ DAEMON_ARGS=""
>  do_start() {
>          echo -n "Starting $NAME: "
>          start-stop-daemon --start --quiet --background --make-pidfile \
> -		--pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS \
> +            --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS \

TAB-to-space conversion. Although I personally prefer that, that is not
the road we've decided to go down in Buildroot, see for reference:
    package/busybox/S01syslogd

In any case, fixing/converting can adshouldbe done in its own patch.

(You missed the TAB on line 35, by the way.)

>                  && echo "OK" || echo "FAIL"
>  }
>  
> diff --git a/package/docker-engine/docker-engine.hash b/package/docker-engine/docker-engine.hash
> index d15b1359cb..670cbd414b 100644
> --- a/package/docker-engine/docker-engine.hash
> +++ b/package/docker-engine/docker-engine.hash
> @@ -1,3 +1,3 @@
>  # Locally calculated
> -sha256  ee0e2168e27ec87f1b0650e86af5d3e167a07fd2ff8c1ce3bb588f0b4f9a4658  docker-engine-20.10.22.tar.gz
> +sha256  94492508260e57eb93399257d53435cd5308ca6330e173ca6e6f3dbf4c6e12f3  docker-engine-23.0.0.tar.gz
>  sha256  7c87873291f289713ac5df48b1f2010eb6963752bbd6b530416ab99fc37914a8  LICENSE
> diff --git a/package/docker-engine/docker-engine.mk b/package/docker-engine/docker-engine.mk
> index 2a9b72ca78..208688cc43 100644
> --- a/package/docker-engine/docker-engine.mk
> +++ b/package/docker-engine/docker-engine.mk
> @@ -4,7 +4,7 @@
>  #
>  ################################################################################
>  
> -DOCKER_ENGINE_VERSION = 20.10.22
> +DOCKER_ENGINE_VERSION = 23.0.0
>  DOCKER_ENGINE_SITE = $(call github,moby,moby,v$(DOCKER_ENGINE_VERSION))
>  
>  DOCKER_ENGINE_LICENSE = Apache-2.0
> @@ -40,6 +40,7 @@ ifeq ($(BR2_INIT_SYSTEMD),y)
>  DOCKER_ENGINE_DEPENDENCIES += systemd
>  DOCKER_ENGINE_TAGS += systemd journald
>  endif
> +

Spurious empty line, although it does make the code look nicer. Maybe
move that with the sysv-init refactoring/cleanup?

>  ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL),y)
>  DOCKER_ENGINE_TAGS += experimental
>  endif
> @@ -62,6 +63,19 @@ else
>  DOCKER_ENGINE_TAGS += exclude_graphdriver_vfs
>  endif
>  
> +# update the go module version to go1.19
> +# docker-engine does not use go modules
> +# remove the conflicting vendor/modules.txt
> +# https://github.com/moby/moby/issues/44618#issuecomment-1343565705
> +define DOCKER_ENGINE_CONFIGURE_CMDS
> +	if [ -f $(@D)/vendor/modules.txt ]; then \
> +		rm $(@D)/vendor/modules.txt; \
> +	fi

No need to test for the presence of a file to remove it; just forcibly
remove it:
    rm -f $(@D)/vendor/modules.txt

Regards,
Yann E. MORIN.

> +	cd $(@D); \
> +		$(HOST_GO_HOST_ENV) $(DOCKER_ENGINE_GO_ENV) \
> +		$(GO_BIN) mod edit -go=1.19 go.mod
> +endef
> +
>  DOCKER_ENGINE_INSTALL_BINS = $(notdir $(DOCKER_ENGINE_BUILD_TARGETS))
>  
>  define DOCKER_ENGINE_INSTALL_INIT_SYSTEMD
> -- 
> 2.39.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
diff mbox series

Patch

diff --git a/package/docker-engine/S60dockerd b/package/docker-engine/S60dockerd
index def8bea149..7591f9fe66 100644
--- a/package/docker-engine/S60dockerd
+++ b/package/docker-engine/S60dockerd
@@ -10,7 +10,7 @@  DAEMON_ARGS=""
 do_start() {
         echo -n "Starting $NAME: "
         start-stop-daemon --start --quiet --background --make-pidfile \
-		--pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS \
+            --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS \
                 && echo "OK" || echo "FAIL"
 }
 
diff --git a/package/docker-engine/docker-engine.hash b/package/docker-engine/docker-engine.hash
index d15b1359cb..670cbd414b 100644
--- a/package/docker-engine/docker-engine.hash
+++ b/package/docker-engine/docker-engine.hash
@@ -1,3 +1,3 @@ 
 # Locally calculated
-sha256  ee0e2168e27ec87f1b0650e86af5d3e167a07fd2ff8c1ce3bb588f0b4f9a4658  docker-engine-20.10.22.tar.gz
+sha256  94492508260e57eb93399257d53435cd5308ca6330e173ca6e6f3dbf4c6e12f3  docker-engine-23.0.0.tar.gz
 sha256  7c87873291f289713ac5df48b1f2010eb6963752bbd6b530416ab99fc37914a8  LICENSE
diff --git a/package/docker-engine/docker-engine.mk b/package/docker-engine/docker-engine.mk
index 2a9b72ca78..208688cc43 100644
--- a/package/docker-engine/docker-engine.mk
+++ b/package/docker-engine/docker-engine.mk
@@ -4,7 +4,7 @@ 
 #
 ################################################################################
 
-DOCKER_ENGINE_VERSION = 20.10.22
+DOCKER_ENGINE_VERSION = 23.0.0
 DOCKER_ENGINE_SITE = $(call github,moby,moby,v$(DOCKER_ENGINE_VERSION))
 
 DOCKER_ENGINE_LICENSE = Apache-2.0
@@ -40,6 +40,7 @@  ifeq ($(BR2_INIT_SYSTEMD),y)
 DOCKER_ENGINE_DEPENDENCIES += systemd
 DOCKER_ENGINE_TAGS += systemd journald
 endif
+
 ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL),y)
 DOCKER_ENGINE_TAGS += experimental
 endif
@@ -62,6 +63,19 @@  else
 DOCKER_ENGINE_TAGS += exclude_graphdriver_vfs
 endif
 
+# update the go module version to go1.19
+# docker-engine does not use go modules
+# remove the conflicting vendor/modules.txt
+# https://github.com/moby/moby/issues/44618#issuecomment-1343565705
+define DOCKER_ENGINE_CONFIGURE_CMDS
+	if [ -f $(@D)/vendor/modules.txt ]; then \
+		rm $(@D)/vendor/modules.txt; \
+	fi
+	cd $(@D); \
+		$(HOST_GO_HOST_ENV) $(DOCKER_ENGINE_GO_ENV) \
+		$(GO_BIN) mod edit -go=1.19 go.mod
+endef
+
 DOCKER_ENGINE_INSTALL_BINS = $(notdir $(DOCKER_ENGINE_BUILD_TARGETS))
 
 define DOCKER_ENGINE_INSTALL_INIT_SYSTEMD