Skip to content

Unknown flag when building helper-dockerarchive-host

Summary

I was creating the gitlab-runner as described on https://docs.gitlab.com/runner/development/README.html and got an error in step 5. make runner-and-helper-bin-host. I checked the Makefile and runner-and-helper-bin-host is a alias for runner-bin-host helper-bin-host helper-dockerarchive-host. When trying to build helper-dockerarchive-host option, it crash because of "unknown flag: --use". I couldn't find anything useful to help correct that.

Steps to reproduce

  1. Download gitlab-runner v13.4.0 or clone the master repo.
  2. Enter the directory.
  3. Run make deps
  4. Run make runner-and-helper-bin-host or make runner-bin-host helper-bin-host helper-dockerarchive-host.

Actual behavior

make crash while building because of "unknown flag: --use"

Expected behavior

To actual build the files

Relevant logs and/or screenshots

job log
root@slackdev:~/gitlab-runner# make runner-and-helper-bin-host     
# Building gitlab-runner in version 13.5.0~beta.84.g2d8a8da7 for host platform
make runner-bin BUILD_PLATFORMS="-osarch=linux/amd64"
make[1]: Entering directory '/root/gitlab-runner'
go get github.com/mitchellh/gox
# Building gitlab-runner in version 13.5.0~beta.84.g2d8a8da7 for -osarch=linux/amd64
gox -osarch=linux/amd64 \
           -ldflags "-X gitlab.com/gitlab-org/gitlab-runner/common.NAME=gitlab-runner -X gitlab.com/gitlab-org/gitlab-runner/common.VERSION=13.5.0~beta.84.g2d8a8da7 -X gitlab.com/gitlab-org/gitlab-runner/common.REVISION=2d8a8da7 -X gitlab.com/gitlab-org/gitlab-runner/common.BUILT=2020-10-02T19:15:43+0000 -X gitlab.com/gitlab-org/gitlab-runner/common.BRANCH=master -s -w" \
           -output="out/binaries/gitlab-runner-{{.OS}}-{{.Arch}}" \
           gitlab.com/gitlab-org/gitlab-runner
Number of parallel builds: 11

-->     linux/amd64: gitlab.com/gitlab-org/gitlab-runner
make[1]: Leaving directory '/root/gitlab-runner'
cp -f "out/binaries/gitlab-runner-linux-amd64" out/binaries/gitlab-runner
go get github.com/mitchellh/gox
gox -osarch=linux/amd64 -ldflags "-X gitlab.com/gitlab-org/gitlab-runner/common.NAME=gitlab-runner -X gitlab.com/gitlab-org/gitlab-runner/common.VERSION=13.5.0~beta.84.g2d8a8da7 -X gitlab.com/gitlab-org/gitlab-runner/common.REVISION=2d8a8da7 -X gitlab.com/gitlab-org/gitlab-runner/common.BUILT=2020-10-02T19:15:43+0000 -X gitlab.com/gitlab-org/gitlab-runner/common.BRANCH=master -s -w" -output=out/binaries/gitlab-runner-helper/gitlab-runner-helper.x86_64 gitlab.com/gitlab-org/gitlab-runner/apps/gitlab-runner-helper
Number of parallel builds: 11

-->     linux/amd64: gitlab.com/gitlab-org/gitlab-runner/apps/gitlab-runner-helper
Building helper image for: linux/amd64
docker-buildx
Successfully created context "docker-buildx"
unknown flag: --use
See 'docker --help'.

Usage:  docker [OPTIONS] COMMAND

A self-sufficient runtime for containers

Options:
      --config string      Location of client config files (default "/root/.docker")
  -c, --context string     Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with "docker context use")
  -D, --debug              Enable debug mode
  -H, --host list          Daemon socket(s) to connect to
  -l, --log-level string   Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
      --tls                Use TLS; implied by --tlsverify
      --tlscacert string   Trust certs signed only by this CA (default "/root/.docker/ca.pem")
      --tlscert string     Path to TLS certificate file (default "/root/.docker/cert.pem")
      --tlskey string      Path to TLS key file (default "/root/.docker/key.pem")
      --tlsverify          Use TLS and verify the remote
  -v, --version            Print version information and quit

Management Commands:
  builder     Manage builds
  checkpoint  Manage checkpoints
  config      Manage Docker configs
  container   Manage containers
  context     Manage contexts
  engine      Manage the docker engine
  image       Manage images
  manifest    Manage Docker image manifests and manifest lists
  network     Manage networks
  node        Manage Swarm nodes
  plugin      Manage plugins
  secret      Manage Docker secrets
  service     Manage services
  stack       Manage Docker stacks
  swarm       Manage Swarm
  system      Manage Docker
  trust       Manage trust on Docker images
  volume      Manage volumes

Commands:
  attach      Attach local standard input, output, and error streams to a running container
  build       Build an image from a Dockerfile
  commit      Create a new image from a container's changes
  cp          Copy files/folders between a container and the local filesystem
  create      Create a new container
  deploy      Deploy a new stack or update an existing stack
  diff        Inspect changes to files or directories on a container's filesystem
  events      Get real time events from the server
  exec        Run a command in a running container
  export      Export a container's filesystem as a tar archive
  history     Show the history of an image
  images      List images
  import      Import the contents from a tarball to create a filesystem image
  info        Display system-wide information
  inspect     Return low-level information on Docker objects
  kill        Kill one or more running containers
  load        Load an image from a tar archive or STDIN
  login       Log in to a Docker registry
  logout      Log out from a Docker registry
  logs        Fetch the logs of a container
  pause       Pause all processes within one or more containers
  port        List port mappings or a specific mapping for the container
  ps          List containers
  pull        Pull an image or a repository from a registry
  push        Push an image or a repository to a registry
  rename      Rename a container
  restart     Restart one or more containers
  rm          Remove one or more containers
  rmi         Remove one or more images
  run         Run a command in a new container
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  search      Search the Docker Hub for images
  start       Start one or more stopped containers
  stats       Display a live stream of container(s) resource usage statistics
  stop        Stop one or more running containers
  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  top         Display the running processes of a container
  unpause     Unpause all processes within one or more containers
  update      Update configuration of one or more containers
  version     Show the Docker version information
  wait        Block until one or more containers stop, then print their exit codes

Run 'docker COMMAND --help' for more information on a command.

make: *** [Makefile.runner_helper.mk:75: out/helper-images/prebuilt-x86_64.tar] Error 125

Environment description

docker info
root@slackdev:~# docker info
Client:
 Debug Mode: false

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 19.03.13
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: c623d1b36f09f8ef6536a057bd658b3aa8632828
 runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 init version: de40ad0 (expected: fec3683)
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.4.69
 Operating System: Slackware 14.2 x86_64 (post 14.2 -current)
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 3.839GiB
 Name: slackdev.trolltech
 ID: HN5L:K4YK:KUFV:R45O:GULP:6HP6:MOET:MO4H:XKTD:CJ7B:TWCJ:GWSX
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: true
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support

Used GitLab Runner version

root@slackdev:~/gitlab-runner# out/binaries/gitlab-runner --version
Version:      13.5.0~beta.84.g2d8a8da7
Git revision: 2d8a8da7
Git branch:   master
GO version:   go1.15.2
Built:        2020-10-02T19:15:43+0000
OS/Arch:      linux/amd64
root@slackdev:~/gitlab-runner-v13.4.0# out/binaries/gitlab-runner --version
Version:      
Git revision: unknown
Git branch:   
GO version:   go1.15.2
Built:        2020-10-02T08:25:23+0000
OS/Arch:      linux/amd64

Possible fixes