Bug 1883773 - opm alpha bundle build fails on win10 home
Summary: opm alpha bundle build fails on win10 home
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.7.0
Assignee: Evan Cordell
QA Contact: kuiwang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-30 08:17 UTC by kuiwang
Modified: 2021-02-24 15:22 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-24 15:21:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github operator-framework operator-registry pull 481 0 None open Bug 1883773: Fix path separator in generated bundle Dockerfiles on Windows. 2020-10-19 21:57:53 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:22:21 UTC

Description kuiwang 2020-09-30 08:17:07 UTC
Description of problem:
we only get one pc with win10 home, and install docker toolbox (can not install docker desktop).
and then we execute opm to build bundle image.
and then meet error
--
Step 8/9 : COPY etcd\0.6.1 /manifests/
COPY failed: stat /mnt/sda1/var/lib/docker/tmp/docker-builder220161348/etcd0.6.1: no such file or directory
--

Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
--
1, get windows-amd64-opm from registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-operator-registry:v4.6
kuiwang@Kuis-MacBook-Pro practice % docker create registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-operator-registry:v4.6
9103c1904b98656ea356482159566d3f429be56878e43c4413757bb2e5947c25

kuiwang@Kuis-MacBook-Pro practice % docker cp 9103c1904b98656ea356482159566d3f429be56878e43c4413757bb2e5947c25:/bin/ tmp

kuiwang@Kuis-MacBook-Pro practice % docker rm 9103c1904b98656ea356482159566d3f429be56878e43c4413757bb2e5947c25
9103c1904b98656ea356482159566d3f429be56878e43c4413757bb2e5947c25

kuiwang@Kuis-MacBook-Pro practice % cd tmp
kuiwang@Kuis-MacBook-Pro tmp % ls|grep -v "opm"|xargs rm -fr
kuiwang@Kuis-MacBook-Pro tmp % ls
darwin-amd64-opm	opm			windows-amd64-opm

transfer windows-amd64-opm to win10 pc

2, install docker toolbox following https://docs.docker.com/toolbox/toolbox_install_windows/
and Click the Docker QuickStart icon to launch a pre-configured Docker Toolbox terminal, and then "docker run hello-world" succeed

3, check docker and opm exist
zhuan@LAPTOP-3QHOAMM2 MINGW64 /d/kuiwang
$ docker version
Client:
 Version:           19.03.1
 API version:       1.40
 Go version:        go1.12.7
 Git commit:        74b1e89e8a
 Built:             Wed Jul 31 15:18:18 2019
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.12
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.10
  Git commit:       48a66213fe
  Built:            Mon Jun 22 15:49:35 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

zhuan@LAPTOP-3QHOAMM2 MINGW64 /d/kuiwang
$ opm -h
CLI to interact with operator-registry and build indexes of operator content

Usage:
  opm [command]

Available Commands:
  help        Help about any command
  index       generate operator index container images
  registry    interact with operator-registry database
  version     Print the opm version

Flags:
  -h, --help       help for opm
      --skip-tls   skip TLS certificate verification for container image registries while pulling bundles or index

Use "opm [command] --help" for more information about a command.

4, check package manifest exist
zhuan@LAPTOP-3QHOAMM2 MINGW64 /d/kuiwang
$ dir
etcd

zhuan@LAPTOP-3QHOAMM2 MINGW64 /d/kuiwang
$ cd etcd

zhuan@LAPTOP-3QHOAMM2 MINGW64 /d/kuiwang/etcd
$ dir
0.6.1  0.9.0  0.9.2  0.9.2-clusterwide  0.9.4  0.9.4-clusterwide  etcd.package.yaml  metadata

zhuan@LAPTOP-3QHOAMM2 MINGW64 /d/kuiwang/etcd
$ cd ..


5, build bundle image
zhuan@LAPTOP-3QHOAMM2 MINGW64 /d/kuiwang
$ opm alpha bundle build --directory etcd/0.6.1 --tag quay.io/kuiwang/etcd-bundle:vwin061 --package etcd --channels alpha --default alpha
time="2020-09-30T15:18:21+08:00" level=info msg="Building annotations.yaml"
time="2020-09-30T15:18:21+08:00" level=info msg="Writing annotations.yaml in D:\\kuiwang\\etcd\\metadata"
time="2020-09-30T15:18:21+08:00" level=info msg="Building Dockerfile"
time="2020-09-30T15:18:21+08:00" level=info msg="Writing bundle.Dockerfile in D:\\kuiwang"
time="2020-09-30T15:18:21+08:00" level=info msg="Building bundle image"
Sending build context to Docker daemon  133.1kB
Step 1/9 : FROM scratch
 --->
Step 2/9 : LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
 ---> Running in a5fb38c108f8
Removing intermediate container a5fb38c108f8
 ---> cc2fd4349d74
Step 3/9 : LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
 ---> Running in cb9f9239ab8c
Removing intermediate container cb9f9239ab8c
 ---> 6eb34c8053ab
Step 4/9 : LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
 ---> Running in 6f3a32b4e88f
Removing intermediate container 6f3a32b4e88f
 ---> 020a839cce79
Step 5/9 : LABEL operators.operatorframework.io.bundle.package.v1=etcd
 ---> Running in 5d4939adc6e5
Removing intermediate container 5d4939adc6e5
 ---> 2d7f06bacdfd
Step 6/9 : LABEL operators.operatorframework.io.bundle.channels.v1=alpha
 ---> Running in e6f041cfd713
Removing intermediate container e6f041cfd713
 ---> 1b32eb0d6e45
Step 7/9 : LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha
 ---> Running in a2276ed39116
Removing intermediate container a2276ed39116
 ---> a21b8ae4002b
Step 8/9 : COPY etcd\0.6.1 /manifests/
COPY failed: stat /mnt/sda1/var/lib/docker/tmp/docker-builder220161348/etcd0.6.1: no such file or directory
Error: Failed to exec []string{"docker", "build", "-f", "bundle.Dockerfile", "-t", "quay.io/kuiwang/etcd-bundle:vwin061", "."}: exit status 1
Usage:
  opm alpha bundle build [flags]

Flags:
  -c, --channels directory     The list of channels that bundle image belongs to(Required if directory is not pointing to a bundle in the nested bundle format)
  -e, --default string         The default channel for the bundle image
  -d, --directory string       The directory where bundle manifests and metadata for a specific version are located
  -h, --help                   help for build
  -b, --image-builder string   Tool used to manage container images. One of: [docker, podman, buildah] (default "docker")
  -u, --output-dir string      Optional output directory for operator manifests
  -o, --overwrite false        To overwrite annotations.yaml locally if existed. By default, overwrite is set to false.
  -p, --package directory      The name of the package that bundle image belongs to (Required if directory is not pointing to a bundle in the nested bundle format)
  -t, --tag string             The image tag applied to the bundle image

Global Flags:
      --skip-tls   skip TLS certificate verification for container image registries while pulling bundles or index

zhuan@LAPTOP-3QHOAMM2 MINGW64 /d/kuiwang
$
zhuan@LAPTOP-3QHOAMM2 MINGW64 /d/kuiwang
$ cat bundle.Dockerfile
FROM scratch

LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=etcd
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha

COPY etcd\0.6.1 /manifests/
COPY etcd\metadata /metadata/


6, switch to cmd terminal and still fails
D:\kuiwang>opm alpha bundle build --directory etcd\0.6.1 --tag quay.io/kuiwang/etcd-bundle:vwin061 --package etcd --channels alpha --default alpha
time="2020-09-30T15:23:03+08:00" level=info msg="Building annotations.yaml"
time="2020-09-30T15:23:03+08:00" level=info msg="Writing annotations.yaml in D:\\kuiwang\\etcd\\metadata"
time="2020-09-30T15:23:03+08:00" level=info msg="Building Dockerfile"
time="2020-09-30T15:23:03+08:00" level=info msg="Writing bundle.Dockerfile in D:\\kuiwang"
time="2020-09-30T15:23:03+08:00" level=info msg="Building bundle image"
Sending build context to Docker daemon  133.1kB
Step 1/9 : FROM scratch
 --->
Step 2/9 : LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
 ---> Using cache
 ---> cc2fd4349d74
Step 3/9 : LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
 ---> Using cache
 ---> 6eb34c8053ab
Step 4/9 : LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
 ---> Using cache
 ---> 020a839cce79
Step 5/9 : LABEL operators.operatorframework.io.bundle.package.v1=etcd
 ---> Using cache
 ---> 2d7f06bacdfd
Step 6/9 : LABEL operators.operatorframework.io.bundle.channels.v1=alpha
 ---> Using cache
 ---> 1b32eb0d6e45
Step 7/9 : LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha
 ---> Using cache
 ---> a21b8ae4002b
Step 8/9 : COPY etcd\0.6.1 /manifests/
COPY failed: stat /mnt/sda1/var/lib/docker/tmp/docker-builder450309712/etcd0.6.1: no such file or directory
Error: Failed to exec []string{"docker", "build", "-f", "bundle.Dockerfile", "-t", "quay.io/kuiwang/etcd-bundle:vwin061", "."}: exit status 1
Usage:
  opm alpha bundle build [flags]

Flags:
  -c, --channels directory     The list of channels that bundle image belongs to(Required if directory is not pointing to a bundle in the nested bundle format)
  -e, --default string         The default channel for the bundle image
  -d, --directory string       The directory where bundle manifests and metadata for a specific version are located
  -h, --help                   help for build
  -b, --image-builder string   Tool used to manage container images. One of: [docker, podman, buildah] (default "docker")
  -u, --output-dir string      Optional output directory for operator manifests
  -o, --overwrite false        To overwrite annotations.yaml locally if existed. By default, overwrite is set to false.
  -p, --package directory      The name of the package that bundle image belongs to (Required if directory is not pointing to a bundle in the nested bundle format)
  -t, --tag string             The image tag applied to the bundle image

Global Flags:
      --skip-tls   skip TLS certificate verification for container image registries while pulling bundles or index


D:\kuiwang>type bundle.Dockerfile
FROM scratch

LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=etcd
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha

COPY etcd\0.6.1 /manifests/
COPY etcd\metadata /metadata/

D:\kuiwang>

--
Actual results:
can not build bundle image on win10

Expected results:
can build bundle image on win10


Additional info:

Comment 7 kuiwang 2020-10-21 01:41:43 UTC
verify it on 4.7. LGTM

--
zhuan@LAPTOP-3QHOAMM2 MINGW64 ~/opm
$ opm alpha bundle build --directory etcd/0.6.1 --tag quay.io/kuiwang/etcd-bundle:vwin061 --package etcd --channels alpha --default alpha
time="2020-10-20T14:48:11+08:00" level=info msg="Building annotations.yaml"
time="2020-10-20T14:48:11+08:00" level=info msg="Writing annotations.yaml in C:\\Users\\zhuan\\opm\\etcd\\metadata"
time="2020-10-20T14:48:11+08:00" level=info msg="Building Dockerfile"
time="2020-10-20T14:48:11+08:00" level=info msg="Writing bundle.Dockerfile in C:\\Users\\zhuan\\opm"
time="2020-10-20T14:48:11+08:00" level=info msg="Building bundle image"
Sending build context to Docker daemon  92.84MB
Step 1/9 : FROM scratch
 --->
Step 2/9 : LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
 ---> Using cache
 ---> cc2fd4349d74
Step 3/9 : LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
 ---> Using cache
 ---> 6eb34c8053ab
Step 4/9 : LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
 ---> Using cache
 ---> 020a839cce79
Step 5/9 : LABEL operators.operatorframework.io.bundle.package.v1=etcd
 ---> Using cache
 ---> 2d7f06bacdfd
Step 6/9 : LABEL operators.operatorframework.io.bundle.channels.v1=alpha
 ---> Using cache
 ---> 1b32eb0d6e45
Step 7/9 : LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha
 ---> Using cache
 ---> a21b8ae4002b
Step 8/9 : COPY etcd/0.6.1 /manifests/
 ---> 95f1fbff1ba3
Step 9/9 : COPY etcd/metadata /metadata/
 ---> 2b8d42132b13
Successfully built 2b8d42132b13
Successfully tagged quay.io/kuiwang/etcd-bundle:vwin061
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.

zhuan@LAPTOP-3QHOAMM2 MINGW64 ~/opm
$

--

Comment 10 errata-xmlrpc 2021-02-24 15:21:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:5633


Note You need to log in before you can comment on or make changes to this bug.