concourse / registry-image-resource

a resource for images in a Docker registry
Apache License 2.0
89 stars 107 forks source link

registry-image fails where docker-image succeeds #283

Open kalensk opened 3 years ago

kalensk commented 3 years ago

When upgrading from the docker-image resource to the registry-image a test that works for docker-image is failing with registry-image. Below is the minimal reproduction. Thanks for @bradfordb-vmware for the help!

Given: noinstall-tests.yml

PLATFORM: linux

image_resource:
  type: registry-image
  source:
    repository: golang
    tag: '1.16'

run:
  path: bash
  args:
  - -c
  - |
    set -ex

    cat /etc/mtab

Running: fly -t cm execute -c noinstall-tests.yml

Returns:

uploading gpupgrade done
executing build 92991 at https://cm.ci.gpdb.pivotal.io/builds/92991
initializing
fetching golang@sha256:be0e3a0f3ffa448b0bcbb9019edca692b8278407a44dc138c60e6f12f0218f87
2021/06/07 19:27:01 [DEBUG] GET https://index.docker.io/v2/
2021/06/07 19:27:01 [DEBUG] GET https://auth.docker.io/token?scope=repository%3Alibrary%2Fgolang%3Apull&service=registry.docker.io
2021/06/07 19:27:01 [DEBUG] GET https://index.docker.io/v2/library/golang/manifests/sha256:be0e3a0f3ffa448b0bcbb9019edca692b8278407a44dc138c60e6f12f0218f87
2021/06/07 19:27:02 [DEBUG] GET https://index.docker.io/v2/library/golang/blobs/sha256:d960726af2bec62a87ceb07182f7b94c47be03909077e23d8226658f80b47f87
d960726af2be [========================================] 47.7MiB/48.1MiB
e8d62473a22d [----------------------------------------------] 0b/7.5MiB
d960726af2be [========================================] 48.1MiB/48.1MiB
e8d62473a22d [================================>---------] 5.8MiB/7.5MiB
d960726af2be [========================================] 48.1MiB/48.1MiB
e8d62473a22d [==========================================] 7.5MiB/7.5MiB
d960726af2be [========================================] 48.1MiB/48.1MiB
e8d62473a22d [==========================================] 7.5MiB/7.5MiB
d960726af2be [========================================] 48.1MiB/48.1MiB
e8d62473a22d [==========================================] 7.5MiB/7.5MiB
d960726af2be [========================================] 48.1MiB/48.1MiB
e8d62473a22d [==========================================] 7.5MiB/7.5MiB
d960726af2be [========================================] 48.1MiB/48.1MiB
e8d62473a22d [==========================================] 7.5MiB/7.5MiB
8962bc0fad55 [==========================================] 9.5MiB/9.5MiB
65d943ee54c1 [========================================] 49.4MiB/49.4MiB
f2253e6fbefa [========================================] 65.6MiB/65.6MiB
186c77a2a533 [======================================] 123.1MiB/123.1MiB
db807893dccf [==============================================] 156b/156b
2021/06/07 19:27:20 [DEBUG] GET https://index.docker.io/v2/library/golang/blobs/sha256:b09f7387a7195b1cfe0144557a8e33af2174426a4b76cb89e499093803d02e7b
running bash -c set -ex

cat /etc/mtab

+ cat /etc/mtab
cat: /etc/mtab: No such file or directory
failed

However, when using the docker-image resource it succeeds. Specifically,

Given: noinstall-tests.yml

PLATFORM: linux

image_resource:
  type: docker-image
  source:
    repository: golang
    tag: '1.16'

run:
  path: bash
  args:
  - -c
  - |
    set -ex

    cat /etc/mtab

Running: fly -t cm execute -c noinstall-tests.yml

Returns:

uploading gpupgrade done
executing build 92992 at https://cm.ci.gpdb.pivotal.io/builds/92992
initializing
running bash -c set -ex

cat /etc/mtab

+ cat /etc/mtab
overlay / overlay rw,relatime,lowerdir=/var/vcap/data/worker/work/overlays/b584ae3e-4bba-4f79-56c3-b9ae3a09f4d5,upperdir=/var/vcap/data/worker/work/overlays/eb9c7091-2ca0-40ad-5b3b-59d8d2c6d2a7,workdir=/var/vcap/data/worker/work/overlays/work/eb9c7091-2ca0-40ad-5b3b-59d8d2c6d2a7 0 0
sysfs /sys sysfs ro,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev/shm tmpfs rw,nodev,relatime,uid=4294967294,gid=4294967294 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666 0 0
/dev/sda1 /tmp/garden-init ext4 rw,relatime,data=ordered 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,relatime,mode=755,uid=4294967294,gid=4294967294 0 0
cgroup /sys/fs/cgroup/systemd cgroup ro,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd 0 0
cgroup /sys/fs/cgroup/rdma cgroup ro,nosuid,nodev,noexec,relatime,rdma 0 0
cgroup /sys/fs/cgroup/perf_event cgroup ro,nosuid,nodev,noexec,relatime,perf_event 0 0
cgroup /sys/fs/cgroup/freezer cgroup ro,nosuid,nodev,noexec,relatime,freezer 0 0
cgroup /sys/fs/cgroup/memory cgroup ro,nosuid,nodev,noexec,relatime,memory 0 0
cgroup /sys/fs/cgroup/net_cls,net_prio cgroup ro,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0
cgroup /sys/fs/cgroup/devices cgroup ro,nosuid,nodev,noexec,relatime,devices 0 0
cgroup /sys/fs/cgroup/cpu,cpuacct cgroup ro,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0
cgroup /sys/fs/cgroup/cpuset cgroup ro,nosuid,nodev,noexec,relatime,cpuset 0 0
cgroup /sys/fs/cgroup/hugetlb cgroup ro,nosuid,nodev,noexec,relatime,hugetlb 0 0
cgroup /sys/fs/cgroup/pids cgroup ro,nosuid,nodev,noexec,relatime,pids 0 0
cgroup /sys/fs/cgroup/blkio cgroup ro,nosuid,nodev,noexec,relatime,blkio 0 0
/dev/sda3 /scratch ext4 rw,relatime,data=ordered 0 0
/dev/sda3 /tmp/build/e55deab7 ext4 rw,relatime,data=ordered 0 0
/dev/sda3 /etc/hosts ext4 rw,relatime,data=ordered 0 0
/dev/sda3 /etc/resolv.conf ext4 rw,relatime,data=ordered 0 0
devtmpfs /dev/null devtmpfs rw,nosuid,size=30904944k,nr_inodes=7726236,mode=755 0 0
devtmpfs /dev/random devtmpfs rw,nosuid,size=30904944k,nr_inodes=7726236,mode=755 0 0
devtmpfs /dev/full devtmpfs rw,nosuid,size=30904944k,nr_inodes=7726236,mode=755 0 0
devtmpfs /dev/tty devtmpfs rw,nosuid,size=30904944k,nr_inodes=7726236,mode=755 0 0
devtmpfs /dev/zero devtmpfs rw,nosuid,size=30904944k,nr_inodes=7726236,mode=755 0 0
devtmpfs /dev/urandom devtmpfs rw,nosuid,size=30904944k,nr_inodes=7726236,mode=755 0 0
devtmpfs /proc/kcore devtmpfs rw,nosuid,size=30904944k,nr_inodes=7726236,mode=755 0 0
devtmpfs /proc/sched_debug devtmpfs rw,nosuid,size=30904944k,nr_inodes=7726236,mode=755 0 0
tmpfs /proc/scsi tmpfs ro,relatime,uid=4294967294,gid=4294967294 0 0
devtmpfs /proc/timer_list devtmpfs rw,nosuid,size=30904944k,nr_inodes=7726236,mode=755 0 0
devtmpfs /proc/keys devtmpfs rw,nosuid,size=30904944k,nr_inodes=7726236,mode=755 0 0
tmpfs /sys/firmware tmpfs ro,relatime,uid=4294967294,gid=4294967294 0 0
succeeded