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

issue building from branch of git repo context #1934

Closed
dustymabe opened this issue Oct 21, 2019 · 4 comments
Closed

issue building from branch of git repo context #1934

dustymabe opened this issue Oct 21, 2019 · 4 comments

Comments

@dustymabe
Copy link

I'm having an issue trying to specify a branch to build from like described here under Build Syntax Suffix.

Here is an example where I am trying to build from the dusty branch:

[vagrant@vanilla-f31 ~]$ sudo /usr/bin/podman build -t simple-kmod-a8c6682:5.3.7-300.fc31.x86_64 --label=name=simple-kmod --build-arg KVER=5.3.7-300.fc31.x86_64 --build-arg KMODVER=a8c6682 git://github.com/dustymabe/kvc-simple-kmod#dusty
Error: error prepping temporary context directory: exit status 128
[vagrant@vanilla-f31 ~]$ 
[vagrant@vanilla-f31 ~]$ sudo /usr/bin/podman build -t simple-kmod-a8c6682:5.3.7-300.fc31.x86_64 --label=name=simple-kmod --build-arg KVER=5.3.7-300.fc31.x86_64 --build-arg KMODVER=a8c6682 https://github.com/dustymabe/kvc-simple-kmod#dusty
Error: no FROM statement found

Sorry for being brief but I don't have much time right now to provide all the information needed.

Version Info

[vagrant@vanilla-f31 ~]$ rpm -q podman
podman-1.6.2-2.fc31.x86_64
[vagrant@vanilla-f31 ~]$ sudo podman version
Version:            1.6.2
RemoteAPI Version:  1
Go Version:         go1.13.1
OS/Arch:            linux/amd64

Output of podman info:

[vagrant@vanilla-f31 ~]$ sudo podman info
host:
  BuildahVersion: 1.11.3
  CgroupVersion: v2
  Conmon:
    package: conmon-2.0.1-1.fc31.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.1, commit: 5e0eadedda9508810235ab878174dca1183f4013'
  Distribution:
    distribution: fedora
    version: "31"
  MemFree: 3720368128
  MemTotal: 4126642176
  OCIRuntime:
    name: crun
    package: crun-0.10.2-1.fc31.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.10.2
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  SwapFree: 0
  SwapTotal: 0
  arch: amd64
  cpus: 4
  eventlogger: journald
  hostname: vanilla-f31
  kernel: 5.3.7-300.fc31.x86_64
  os: linux
  rootless: false
  uptime: 15m 9.03s
registries:
  blocked: null
  insecure: null
  search:
  - docker.io
  - registry.fedoraproject.org
  - quay.io
  - registry.access.redhat.com
  - registry.centos.org
store:
  ConfigFile: /etc/containers/storage.conf
  ContainerStore:
    number: 0
  GraphDriverName: overlay
  GraphOptions:
    overlay.mountopt: nodev,metacopy=on
  GraphRoot: /var/lib/containers/storage
  GraphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  ImageStore:
    number: 14
  RunRoot: /var/run/containers/storage
  VolumePath: /var/lib/containers/storage/volumes

@TomSweeneyRedHat
Copy link
Member

@dustymabe I'm able to replicate it. It looks like the last bit of the context directory #dusty is throwing the command line parsing for a loop. If I remove just that, then things seem to build fine (but obviously not in the right branch). It should work with it and I'm trying to figure out where it's going south ATM.

@TomSweeneyRedHat
Copy link
Member

I know what's happening, the code is in essence doing:

# git clone git://github.com/dustymabe/kvc-simple-kmod#dusty /var/tmp/buildah173938704

which returns:

Cloning into '/var/tmp/buildah173938704'...
fatal: remote error: 
  dustymabe/kvc-simple-kmod#dusty is not a valid repository name
  Email [email protected] for help

I need to change the code in Buildah that does the git clone so that it recognizes the appended branch name and instead does this:

# git clone -b dusty git://github.com/dustymabe/kvc-simple-kmod /var/tmp/buildah173938704

Hopefully can get that out for review later today.

@dustymabe
Copy link
Author

+1 - thanks

TomSweeneyRedHat added a commit to TomSweeneyRedHat/buildah that referenced this issue Oct 22, 2019
If the context directory was specified as a git repo with a
branch reference ala

```

```

The internal `git clone` command executed by buildah would fail as the
`#master` branch specification needed to be removed and specified with
the `-b` option like:

```
git clone -b master git://github.com/containers/skopeo /var/tmp/buildah12332
```
rather than:
```
git clone git://github.com/containers/skopeo#master /var/tmp/buildah12332
```

Addresses containers#1934

Signed-off-by: TomSweeneyRedHat <[email protected]>
TomSweeneyRedHat added a commit to TomSweeneyRedHat/buildah that referenced this issue Oct 22, 2019
If the context directory was specified as a git repo with a
branch reference ala

```
buildah bud --layers -t test git://github.com/containers/skopeo#master
```

The internal `git clone` command executed by buildah would fail as the
`#master` branch specification needed to be removed and specified with
the `-b` option like:

```
git clone -b master git://github.com/containers/skopeo /var/tmp/buildah12332
```
rather than:
```
git clone git://github.com/containers/skopeo#master /var/tmp/buildah12332
```

Addresses containers#1934

Signed-off-by: TomSweeneyRedHat <[email protected]>
rh-atomic-bot pushed a commit that referenced this issue Oct 23, 2019
If the context directory was specified as a git repo with a
branch reference ala

```
buildah bud --layers -t test git://github.com/containers/skopeo#master
```

The internal `git clone` command executed by buildah would fail as the
`#master` branch specification needed to be removed and specified with
the `-b` option like:

```
git clone -b master git://github.com/containers/skopeo /var/tmp/buildah12332
```
rather than:
```
git clone git://github.com/containers/skopeo#master /var/tmp/buildah12332
```

Addresses #1934

Signed-off-by: TomSweeneyRedHat <[email protected]>

Closes: #1941
Approved by: rhatdan
@rhatdan
Copy link
Member

rhatdan commented Oct 23, 2019

Since #1941 is merged, this issue is fixed upstream

caiges pushed a commit to caiges/buildah that referenced this issue Nov 12, 2019
If the context directory was specified as a git repo with a
branch reference ala

```
buildah bud --layers -t test git://github.com/containers/skopeo#master
```

The internal `git clone` command executed by buildah would fail as the
`#master` branch specification needed to be removed and specified with
the `-b` option like:

```
git clone -b master git://github.com/containers/skopeo /var/tmp/buildah12332
```
rather than:
```
git clone git://github.com/containers/skopeo#master /var/tmp/buildah12332
```

Addresses containers#1934

Signed-off-by: TomSweeneyRedHat <[email protected]>

Closes: containers#1941
Approved by: rhatdan
@rhatdan rhatdan closed this as completed Aug 5, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants