Skip to content

Extension init command fails #304

@Pive01

Description

@Pive01

Describe the bug
When initializing a new extension, the "initializing new go module" part fails with the following output

Initializing new go module...
error while executing 'docker run --rm -w=/src -v/home/luca/Code/test/my-extension/backend:/src golang:1.21-alpine /bin/sh -c go mod init my-extension && go mod tidy' : exit status 1: go: creating new go.mod: module my-extension
go: to add module requirements and sums:
	go mod tidy
go: finding module for package github.com/sirupsen/logrus
go: finding module for package github.com/labstack/echo/v4
go: finding module for package github.com/labstack/echo/v4/middleware
go: downloading github.com/sirupsen/logrus v1.9.3
go: downloading github.com/labstack/echo v3.3.10+incompatible
go: downloading github.com/labstack/echo/v4 v4.13.4
go: toolchain upgrade needed to resolve github.com/labstack/echo/v4
go: github.com/labstack/echo/v4@v4.13.4 requires go >= 1.23.0 (running go 1.21.13; GOTOOLCHAIN=local)

Add the steps to reproduce
Simply try to create a new extension with docker extension init my-extension and see the errors

Describe the expected behavior
I would expect this command to not fails....seems like it could be fixed by just updating the image used in the command to golang:1.23 or higher

Optional: Add screenshots

Image

Output of docker extension version:

Client Version: v0.2.27
Server API Version: 0.3.4

Output of docker version:

Client: Docker Engine - Community
 Version:           28.0.2
 API version:       1.48
 Go version:        go1.23.7
 Git commit:        0442a73
 Built:             Wed Mar 19 14:36:46 2025
 OS/Arch:           linux/amd64
 Context:           desktop-linux

Server: Docker Desktop 4.41.2 (191736)
 Engine:
  Version:          28.1.1
  API version:      1.49 (minimum version 1.24)
  Go version:       go1.23.8
  Git commit:       01f442b
  Built:            Fri Apr 18 09:52:57 2025
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.27
  GitCommit:        05044ec0a9a75232cad458027ca83437aae3f4da
 runc:
  Version:          1.2.5
  GitCommit:        v1.2.5-0-g59923ef
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Additional context
Maybe related to #220

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions