containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
23.83k stars 2.42k forks source link

podman build https://github.com/scollier/purpletest from examples fails #21605

Closed jankatins closed 9 months ago

jankatins commented 9 months ago

Issue Description

The example in the docs for building from a git repo seems to be outdated or wrong.

My podman version (from debian unstable):

λ podman version
Client:       Podman Engine
Version:      4.9.2
API Version:  4.9.2
Go Version:   go1.21.6
Built:        Thu Jan  1 01:00:00 1970
OS/Arch:      linux/amd64

Steps to reproduce the issue

I tried to build a repo directly form github (so I need more form the repo than the Dockerfile) and found the example:

λ podman build https://github.com/scollier/purpletest
Error: prepping temporary context directory: invalid response status 404

With some trial and error on my particular repo (https://github.com/bohwaz/micro-gpodder-server.git#main), I figured out that one has to add a .git to the repo part, but that also errors:

λ podman build https://github.com/scollier/purpletest.git
Error: prepping temporary context directory: cloning "https://github.com/scollier/purpletest.git" to "/var/tmp/buildah1200610337":
Please complete authentication in your browser...
https://github.com/login/oauth/authorize?...
remote: Repository not found.
fatal: repository 'https://github.com/scollier/purpletest.git/' not found
: failed while performing `git fetch`: exit status 128

My interpretation is that this repo does not exist anymore. The first error without the .git seems to mistake the git repo URL for a regular URL to a Dockerfile and therefore cannot interpret the result as is.

Describe the results you received

The example errors as shown above

Describe the results you expected

A built docker image.

Note, with podman build https://github.com/bohwaz/micro-gpodder-server.git it worked, so it's more that there is too few (or wrong) guidance in the docs or no helpful error message nudging one into the right direction:-)

podman info output

λ  podman info
host:
  arch: amd64
  buildahVersion: 1.33.5
  cgroupControllers:
  - cpu
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon_2.1.6+ds1-1_amd64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.6, commit: unknown'
  cpuUtilization:
    idlePercent: 48.6
    systemPercent: 13.79
    userPercent: 37.61
  cpus: 8
  databaseBackend: boltdb
  distribution:
    codename: trixie
    distribution: debian
    version: unknown
  eventLogger: journald
  freeLocks: 2046
  hostname: bloodaxe
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 6.6.11-amd64
  linkmode: dynamic
  logDriver: journald
  memFree: 686919680
  memTotal: 16443879424
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns_1.4.0-5_amd64
      path: /usr/lib/podman/aardvark-dns
      version: aardvark-dns 1.4.0
    package: netavark_1.4.0-4_amd64
    path: /usr/lib/podman/netavark
    version: netavark 1.4.0
  ociRuntime:
    name: crun
    package: crun_1.14-1_amd64
    path: /usr/bin/crun
    version: |-
      crun version 1.14
      commit: 667e6ebd4e2442d39512e63215e79d693d0780aa
      rundir: /run/user/1000/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt_0.0~git20231230.f091893-1_amd64
    version: |
      pasta unknown version
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns_1.2.1-1_amd64
    version: |-
      slirp4netns version 1.2.1
      commit: 09e31e92fa3d2a1d3ca261adaeb012c8d75a8194
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.5
  swapFree: 139886592
  swapTotal: 1023406080
  uptime: 597h 47m 11.00s (Approximately 24.88 days)
  variant: ""
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries: {}
store:
  configFile: /home/jan/.config/containers/storage.conf
  containerStore:
    number: 1
    paused: 0
    running: 0
    stopped: 1
  graphDriverName: vfs
  graphOptions: {}
  graphRoot: /home/jan/.local/share/containers/storage
  graphRootAllocated: 450557812736
  graphRootUsed: 259283562496
  graphStatus: {}
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 13
  runRoot: /run/user/1000/containers
  transientStore: false
  volumePath: /home/jan/.local/share/containers/storage/volumes
version:
  APIVersion: 4.9.2
  Built: 0
  BuiltTime: Thu Jan  1 01:00:00 1970
  GitCommit: ""
  GoVersion: go1.21.6
  Os: linux
  OsArch: linux/amd64
  Version: 4.9.2

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

debian unstable

giuseppe commented 9 months ago

opened a PR: https://github.com/containers/podman/pull/21612