weixin_39912163
weixin_39912163
2021-01-09 08:13

multi-stage is broken on 1.4?

Description multi-stage is broken on 1.4 (fedora 28).

It works fine when using this version on RHEL 7:


# buildah version
Version:         1.2
Go Version:      go1.9.2
Image Spec:      1.0.0
Runtime Spec:    1.0.0
CNI Spec:        0.3.1
libcni Version:  v0.6.0
Git Commit:      be87762
Built:           Thu Jul 19 20:47:23 2018
OS/Arch:         linux/amd64

Steps to reproduce the issue:


# go get github.com/hongkailiu/test-go/cmd
# cd go/src/github.com/hongkailiu/test-go/
# buildah bud --format=docker -f test_files/docker/Dockerfile.http.txt -t quay.io/hongkailiu/test-go:http-0.0.3 .
STEP 1: FROM docker.io/golang:1.11
STEP 2: RUN go version
container exited on segmentation fault
error building at step {Env:[PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin GOLANG_VERSION=1.11.1 GOPATH=/go] Command:run Args:[go version] Flags:[] Attrs:map[] Message:RUN go version Original:RUN go version}: exit status 1

Describe the results you received:

Describe the results you expected:

Output of rpm -q buildah or apt list buildah:


# rpm -q buildah
buildah-1.4-3.git608fa84.fc28.x86_64

Output of buildah version:


# buildah version
Version:         1.4
Go Version:      go1.10.4
Image Spec:      1.0.0
Runtime Spec:    1.0.0
CNI Spec:        0.4.0
libcni Version:  v0.7.0-alpha1
Git Commit:      608fa84
Built:           Thu Oct  4 16:40:10 2018
OS/Arch:         linux/amd64

Output of podman version if reporting a podman build issue:


(paste your output here)

Output of cat /etc/*release:


# cat /etc/*release
Fedora release 28 (Twenty Eight)
NAME=Fedora
VERSION="28 (Cloud Edition)"
ID=fedora
VERSION_ID=28
PLATFORM_ID="platform:f28"
PRETTY_NAME="Fedora 28 (Cloud Edition)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:fedoraproject:fedora:28"
HOME_URL="https://fedoraproject.org/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=28
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=28
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Cloud Edition"
VARIANT_ID=cloud
Fedora release 28 (Twenty Eight)
Fedora release 28 (Twenty Eight)

Output of uname -a:


# uname -a
Linux ip-172-31-7-220.us-west-2.compute.internal 4.16.3-301.fc28.x86_64 #1 SMP Mon Apr 23 21:59:58 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Output of cat /etc/containers/storage.conf:


# cat /etc/containers/storage.conf
# This file is is the configuration file for all tools
# that use the containers/storage library.
# See man 5 containers-storage.conf for more information
# The "container storage" table contains all of the server options.
[storage]

# Default Storage Driver
driver = "overlay"

# Temporary storage location
runroot = "/var/run/containers/storage"

# Primary Read/Write location of container storage
graphroot = "/var/lib/containers/storage"

[storage.options]
# Storage options to be passed to underlying storage drivers

# AdditionalImageStores is used to pass paths to additional Read/Only image stores
# Must be comma separated list.
additionalimagestores = [
]

# Size is used to set a maximum size of the container image.  Only supported by
# certain container storage drivers.
size = ""

# Path to an helper program to use for mounting the file system instead of mounting it
# directly.
#mount_program = "/usr/bin/fuse-overlayfs"

# OverrideKernelCheck tells the driver to ignore kernel checks based on kernel version
override_kernel_check = "true"

# mountopt specifies comma separated list of extra mount options
mountopt = "nodev"

# Remap-UIDs/GIDs is the mapping from UIDs/GIDs as they should appear inside of
# a container, to UIDs/GIDs as they should appear outside of the container, and
# the length of the range of UIDs/GIDs.  Additional mapped sets can be listed
# and will be heeded by libraries, but there are limits to the number of
# mappings which the kernel will allow when you later attempt to run a
# container.
#
# remap-uids = 0:1668442479:65536
# remap-gids = 0:1668442479:65536

# Remap-User/Group is a name which can be used to look up one or more UID/GID
# ranges in the /etc/subuid or /etc/subgid file.  Mappings are set up starting
# with an in-container ID of 0 and the a host-level ID taken from the lowest
# range that matches the specified name, and using the length of that range.
# Additional ranges are then assigned, using the ranges which specify the
# lowest host-level IDs first, to the lowest not-yet-mapped container-level ID,
# until all of the entries have been used for maps.
#
# remap-user = "storage"
# remap-group = "storage"

[storage.options.thinpool]
# Storage Options for thinpool

# autoextend_percent determines the amount by which pool needs to be
# grown. This is specified in terms of % of pool size. So a value of 20 means
# that when threshold is hit, pool will be grown by 20% of existing
# pool size.
# autoextend_percent = "20"

# autoextend_threshold determines the pool extension threshold in terms
# of percentage of pool size. For example, if threshold is 60, that means when
# pool is 60% full, threshold has been hit.
# autoextend_threshold = "80"

# basesize specifies the size to use when creating the base device, which
# limits the size of images and containers.
# basesize = "10G"

# blocksize specifies a custom blocksize to use for the thin pool.
# blocksize="64k"

# directlvm_device specifies a custom block storage device to use for the
# thin pool. Required if you setup devicemapper.
# directlvm_device = ""

# directlvm_device_force wipes device even if device already has a filesystem.
# directlvm_device_force = "True"

# fs specifies the filesystem type to use for the base device.
# fs="xfs"

# log_level sets the log level of devicemapper.
# 0: LogLevelSuppress 0 (Default)
# 2: LogLevelFatal
# 3: LogLevelErr
# 4: LogLevelWarn
# 5: LogLevelNotice
# 6: LogLevelInfo
# 7: LogLevelDebug
# log_level = "7"

# min_free_space specifies the min free space percent in a thin pool require for
# new device creation to succeed. Valid values are from 0% - 99%.
# Value 0% disables
# min_free_space = "10%"

# mkfsarg specifies extra mkfs arguments to be used when creating the base.
# device.
# mkfsarg = ""

# use_deferred_removal marks devicemapper block device for deferred removal.
# If the thinpool is in use when the driver attempts to remove it, the driver 
# tells the kernel to remove it as soon as possible. Note this does not free
# up the disk space, use deferred deletion to fully remove the thinpool.
# use_deferred_removal = "True"

# use_deferred_deletion marks thinpool device for deferred deletion.
# If the device is busy when the driver attempts to delete it, the driver
# will attempt to delete device every 30 seconds until successful.
# If the program using the driver exits, the driver will continue attempting
# to cleanup the next time the driver is used. Deferred deletion permanently
# deletes the device and all data stored in device will be lost.
# use_deferred_deletion = "True"

# xfs_nospace_max_retries specifies the maximum number of retries XFS should
# attempt to complete IO when ENOSPC (no space) error is returned by
# underlying storage device.
# xfs_nospace_max_retries = "0"

# If specified, use OSTree to deduplicate files with the overlay backend
ostree_repo = ""

# Set to skip a PRIVATE bind mount on the storage home directory.  Only supported by
# certain container storage drivers
skip_mount_home = "false"

该提问来源于开源项目:containers/buildah

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

18条回答

  • weixin_39615956 weixin_39615956 4月前

    Thanks for the issue report. I thought this would be working on v1.4 as we implemented a few changes to better handle multi-stage builds. I'll give it a look in a little bit.

    点赞 评论 复制链接分享
  • weixin_39912163 weixin_39912163 4月前

    Thanks. I also tried to build the master branch ... and hit the same error with the built binary. Then tried with the commit for building 1.2 ... make did not work for that commit since the repo was with a different name at that time. So I gave up.

    点赞 评论 复制链接分享
  • weixin_39615956 weixin_39615956 4月前

    Ok , now I'm puzzled, I tried running this on Fedora 28 with Buildah from upstream master and it worked for me. However I'm not seeing a "RUN go version" at STEP 2 in my output below. Can you verify that I've the right command?

    Also do you have a new vm that you could try this on and see if you get the same error again?

    Thanks!

    
    # buildah bud --format=docker -f test_files/docker/Dockerfile.http.txt -t quay.io/hongkailiu/test-go:http-0.0.3 .
    STEP 1: FROM docker.io/golang:1.11 AS builder
    Getting image source signatures
    Copying blob sha256:bc9ab73e5b14b9fbd3687a4d8c1f1360533d6ee9ffc3f5ecc6630794b40257b7
     43.21 MiB / 43.21 MiB [====================================================] 6s
    Copying blob sha256:193a6306c92af328dbd41bbbd3200a2c90802624cccfe5725223324428110d7f
     10.24 MiB / 10.24 MiB [====================================================] 1s
    Copying blob sha256:e5c3f8c317dc30af45021092a3d76f16ba7aa1ee5f18fec742c84d4960818580
     4.14 MiB / 4.14 MiB [======================================================] 0s
    Copying blob sha256:a587a86c9dcb9df6584180042becf21e36ecd8b460a761711227b4b06889a005
     47.75 MiB / 47.75 MiB [====================================================] 7s
    Copying blob sha256:1bc310ac474b880a5e4aeec02e6423d1304d137f1a8990074cb3ac6386a0b654
     54.92 MiB / 54.92 MiB [====================================================] 8s
    Copying blob sha256:997731689cfbc58c8e74f2a20079338ce66965a40b21f27169b3d5a45ab61cbd
     121.31 MiB / 121.31 MiB [=================================================] 18s
    Copying blob sha256:202760eb4a0043cd84cd9971c47052617855ff653abec8ae479e89d369afd500
     125 B / 125 B [============================================================] 0s
    Copying config sha256:45e48f60e2681653d4cc88b69f8c5504e0b5ba345cc45948d611b89193f45364
     5.33 KiB / 5.33 KiB [======================================================] 0s
    Writing manifest to image destination
    Storing signatures
    STEP 2: RUN go get -d -v github.com/hongkailiu/test-go/cmd
    github.com/hongkailiu/test-go (download)
    STEP 3: WORKDIR /go/src/github.com/hongkailiu/test-go/
    STEP 4: RUN make CGO_ENABLED=0 GOOS=linux build-http
    ./script/ci/build-http.sh
    'http/static' -> 'build/static'
    'http/static/index.html' -> 'build/static/index.html'
    'http/static/js' -> 'build/static/js'
    'http/static/js/test.js' -> 'build/static/js/test.js'
    'http/swagger' -> 'build/swagger'
    'http/swagger/swagger.json' -> 'build/swagger/swagger.json'
    STEP 5: COMMIT containers-storage:[overlay@/var/lib/containers/storage+/var/run/containers/storage:overlay.override_kernel_check=true]quay.io/hongkailiu/test-go:http-0.0.3
    Getting image source signatures
    Skipping fetch of repeat blob sha256:f715ed19c28b66943ac8bc12dbfb828e8394de2530bbaf1ecce906e748e4fdff
    Skipping fetch of repeat blob sha256:8bb25f9cdc41e7d085033af15a522973b44086d6eedd24c11cc61c9232324f77
    Skipping fetch of repeat blob sha256:08a01612ffca33483a1847c909836610610ce523fb7e1aca880140ee84df23e9
    Skipping fetch of repeat blob sha256:1191b3f5862aa9231858809b7ac8b91c0b727ce85c9b3279932f0baacc92967d
    Skipping fetch of repeat blob sha256:52da4d4dcf59a2a01a4c4928516bf922944775862547dad6142bc477bbbdfa47
    Skipping fetch of repeat blob sha256:757fc57926be167de1ddcffd80c1cfafb412f460ece41fd3204e903c662538fd
    Skipping fetch of repeat blob sha256:7a7147543a13ba6e9fd6c49b7fdb9ee2599833c0cb5065fe10c993f64203a9e0
    Copying blob sha256:3ce8422304280f9a06fba8ff3d084328242f53e2f79264ee0c99f7c33e8bc2ee
     99.75 MiB / 99.75 MiB [====================================================] 3s
    Copying config sha256:1bb62579ecd10a9ccb27738ad77e19d4ca8f9406f85417a71f08263232d0332d
     5.54 KiB / 5.54 KiB [======================================================] 0s
    Writing manifest to image destination
    Storing signatures
    --> 1bb62579ecd10a9ccb27738ad77e19d4ca8f9406f85417a71f08263232d0332d
    STEP 6: FROM alpine:3.6
    Getting image source signatures
    Copying blob sha256:3489d1c4660eacaadef3acfc3512c785acde2333b5e6e9387f43490a766382bf
     1.92 MiB / 1.92 MiB [======================================================] 0s
    Copying config sha256:94627dfbdf19f1344aae6ef72db6ff30c5148b60e1091de098807ec4b42febbc
     1.48 KiB / 1.48 KiB [======================================================] 0s
    Writing manifest to image destination
    Storing signatures
    STEP 7: WORKDIR /
    STEP 8: COPY --from=builder /go/src/github.com/hongkailiu/test-go/build/http /http
    STEP 9: CMD ["/http"]
    STEP 10: COMMIT containers-storage:[overlay@/var/lib/containers/storage+/var/run/containers/storage:overlay.override_kernel_check=true]quay.io/hongkailiu/test-go:http-0.0.3
    Getting image source signatures
    Skipping fetch of repeat blob sha256:05c2dea6380d018f777f92d6876db9628f87b12743bce80dc2539488715b3571
    Copying blob sha256:971851f1c9841ae1d7a69399f4e27a0bf40da482fb39990098b0e9a13e01e690
     8.56 MiB / 8.56 MiB [======================================================] 0s
    Copying config sha256:9cbc55a2dee6385730d9d039f8c34deb714c6a31a27a6b5ddda6e9a9ba8c15a7
     1.61 KiB / 1.61 KiB [======================================================] 0s
    Writing manifest to image destination
    Storing signatures
    --> 9cbc55a2dee6385730d9d039f8c34deb714c6a31a27a6b5ddda6e9a9ba8c15a7
    
    点赞 评论 复制链接分享
  • weixin_39912163 weixin_39912163 4月前

    Sorry for the confusion. I copied the error msg from my debugging which replaced the orignal step (go get ...) by a dummy go version. I will try again with a new fedora VM today.

    点赞 评论 复制链接分享
  • weixin_39615956 weixin_39615956 4月前

    thanks! Also as a point to remember, if you change versions of Buildah on a test system, you should delete /var/lib/containers/storage otherwise things can go really sideways when you go from v1.2 to v1.4 on the same test system.

    点赞 评论 复制链接分享
  • weixin_39912163 weixin_39912163 4月前

    The same result as yesterday.

    
    # dnf info buildah
    Last metadata expiration check: 0:02:03 ago on Fri 02 Nov 2018 01:13:38 PM UTC.
    Installed Packages
    Name         : buildah
    Version      : 1.4
    Release      : 3.git608fa84.fc28
    Arch         : x86_64
    Size         : 13 M
    Source       : buildah-1.4-3.git608fa84.fc28.src.rpm
    Repo         : 
    From repo    : updates
    Summary      : A command line tool used for creating OCI Images
    URL          : https://github.com/containers/buildah
    License      : ASL 2.0
    Description  : The buildah package provides a command line tool which can be used to
                 : * create a working container from scratch
                 : or
                 : * create a working container from an image as a starting point
                 : * mount/umount a working container's root file system for manipulation
                 : * save container's root file system layer to create a new image
                 : * delete a working container or an image
    
    [root-172-31-53-26 ~]# go get github.com/hongkailiu/test-go/cmd
    [root-172-31-53-26 ~]# cd go/src/github.com/hongkailiu/test-go/
    [root-172-31-53-26 test-go]# buildah bud --format=docker -f test_files/docker/Dockerfile.http.txt -t quay.io/hongkailiu/test-go:http-0.0.3 .
    STEP 1: FROM docker.io/golang:1.11
    Getting image source signatures
    Copying blob sha256:bc9ab73e5b14b9fbd3687a4d8c1f1360533d6ee9ffc3f5ecc6630794b40257b7
     43.21 MiB / 43.21 MiB [====================================================] 1s
    Copying blob sha256:193a6306c92af328dbd41bbbd3200a2c90802624cccfe5725223324428110d7f
     10.24 MiB / 10.24 MiB [====================================================] 0s
    Copying blob sha256:e5c3f8c317dc30af45021092a3d76f16ba7aa1ee5f18fec742c84d4960818580
     4.14 MiB / 4.14 MiB [======================================================] 0s
    Copying blob sha256:a587a86c9dcb9df6584180042becf21e36ecd8b460a761711227b4b06889a005
     47.75 MiB / 47.75 MiB [====================================================] 2s
    Copying blob sha256:1bc310ac474b880a5e4aeec02e6423d1304d137f1a8990074cb3ac6386a0b654
     54.92 MiB / 54.92 MiB [====================================================] 2s
    Copying blob sha256:997731689cfbc58c8e74f2a20079338ce66965a40b21f27169b3d5a45ab61cbd
     121.31 MiB / 121.31 MiB [==================================================] 4s
    Copying blob sha256:202760eb4a0043cd84cd9971c47052617855ff653abec8ae479e89d369afd500
     125 B / 125 B [============================================================] 0s
    Copying config sha256:45e48f60e2681653d4cc88b69f8c5504e0b5ba345cc45948d611b89193f45364
     5.33 KiB / 5.33 KiB [======================================================] 0s
    Writing manifest to image destination
    Storing signatures
    STEP 2: RUN go get -d -v github.com/hongkailiu/test-go/cmd
    container exited on segmentation fault
    error building at step {Env:[PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin GOLANG_VERSION=1.11.1 GOPATH=/go] Command:run Args:[go get -d -v github.com/hongkailiu/test-go/cmd] Flags:[] Attrs:map[] Message:RUN go get -d -v github.com/hongkailiu/test-go/cmd Original:RUN go get -d -v github.com/hongkailiu/test-go/cmd}: exit status 1
    

    Not sure if this is relevant ... the way i got fedora 28:

    
    $ aws ec2 run-instances --image-id ami-f5fc948d     --security-group-ids sg-5c5ace38 --count 1 --instance-type m5.2xlarge --key-name id_rsa_perf     --subnet subnet-4879292d --block-device-mappings "[{\"DeviceName\":\"/dev/sda1\", \"Ebs\":{\"VolumeSize\": 30}}]"     --query 'Instances[*].InstanceId'     --tag-specifications="[{\"ResourceType\":\"instance\",\"Tags\":[{\"Key\":\"Name\",\"Value\":\"qe-hongkliu-fedora28-test\"}]}]"
    [
        "i-0758d39dc1c6a842a"
    ]
    
    
    点赞 评论 复制链接分享
  • weixin_39912163 weixin_39912163 4月前

    Minimal set of commands to reproduce (after creating the instance with aws cli above):

    
    $ fdr.sh ec2-34-210-201-197.us-west-2.compute.amazonaws.com
    Warning: Permanently added 'ec2-34-210-201-197.us-west-2.compute.amazonaws.com,34.210.201.197' (ECDSA) to the list of known hosts.
    [fedora-172-31-51-21 ~]$ sudo -i
    [root-172-31-51-21 ~]# yum install -y buildah
    Fedora 28 - x86_64 - Updates                                                                     14 MB/s |  26 MB     00:01    
    Fedora 28 - x86_64                                                                               15 MB/s |  60 MB     00:03    
    Last metadata expiration check: 0:00:06 ago on Fri 02 Nov 2018 01:22:44 PM UTC.
    Dependencies resolved.
    ================================================================================================================================
     Package                         Arch                 Version                                       Repository             Size
    ================================================================================================================================
    Installing:
     buildah                         x86_64               1.4-3.git608fa84.fc28                         updates               4.1 M
    Installing dependencies:
     container-selinux               noarch               2:2.74-1.gita62c2db.fc28                      updates                45 k
     containers-common               x86_64               0.1.31-13.dev.gite3034e1.fc28                 updates                32 k
     libnet                          x86_64               1.1.6-15.fc28                                 fedora                 66 k
     ostree-libs                     x86_64               2018.8-1.fc28                                 updates               381 k
     protobuf-c                      x86_64               1.3.0-4.fc28                                  fedora                 36 k
     runc                            x86_64               2:1.0.0-56.dev.git78ef28e.fc28                updates               2.0 M
    Installing weak dependencies:
     criu                            x86_64               3.10-4.fc28                                   updates               480 k
    
    Transaction Summary
    ================================================================================================================================
    Install  8 Packages
    
    Total download size: 7.0 M
    Installed size: 23 M
    Downloading Packages:
    (1/8): containers-common-0.1.31-13.dev.gite3034e1.fc28.x86_64.rpm                                80 kB/s |  32 kB     00:00    
    (2/8): ostree-libs-2018.8-1.fc28.x86_64.rpm                                                     638 kB/s | 381 kB     00:00    
    (3/8): container-selinux-2.74-1.gita62c2db.fc28.noarch.rpm                                      523 kB/s |  45 kB     00:00    
    (4/8): criu-3.10-4.fc28.x86_64.rpm                                                              3.4 MB/s | 480 kB     00:00    
    (5/8): runc-1.0.0-56.dev.git78ef28e.fc28.x86_64.rpm                                             4.5 MB/s | 2.0 MB     00:00    
    (6/8): buildah-1.4-3.git608fa84.fc28.x86_64.rpm                                                 4.3 MB/s | 4.1 MB     00:00    
    (7/8): protobuf-c-1.3.0-4.fc28.x86_64.rpm                                                       125 kB/s |  36 kB     00:00    
    (8/8): libnet-1.1.6-15.fc28.x86_64.rpm                                                          174 kB/s |  66 kB     00:00    
    --------------------------------------------------------------------------------------------------------------------------------
    Total                                                                                           2.9 MB/s | 7.0 MB     00:02     
    Running transaction check
    Transaction check succeeded.
    Running transaction test
    Transaction test succeeded.
    Running transaction
      Preparing        :                                                                                                        1/1 
      Installing       : protobuf-c-1.3.0-4.fc28.x86_64                                                                         1/8 
      Installing       : libnet-1.1.6-15.fc28.x86_64                                                                            2/8 
      Running scriptlet: libnet-1.1.6-15.fc28.x86_64                                                                            2/8 
      Installing       : container-selinux-2:2.74-1.gita62c2db.fc28.noarch                                                      3/8 
      Running scriptlet: container-selinux-2:2.74-1.gita62c2db.fc28.noarch                                                      3/8 
    neverallow check failed at /var/lib/selinux/targeted/tmp/modules/100/base/cil:9156
      (neverallow base_typeattr_7 unlabeled_t (file (entrypoint)))
        <root>
        allow at /var/lib/selinux/targeted/tmp/modules/200/container/cil:1575
          (allow spc_t unlabeled_t (file (entrypoint)))
    
    Failed to generate binary
    /usr/sbin/semodule:  Failed!
      Installing       : runc-2:1.0.0-56.dev.git78ef28e.fc28.x86_64                                                             4/8 
      Installing       : ostree-libs-2018.8-1.fc28.x86_64                                                                       5/8 
      Installing       : containers-common-0.1.31-13.dev.gite3034e1.fc28.x86_64                                                 6/8 
      Installing       : buildah-1.4-3.git608fa84.fc28.x86_64                                                                   7/8 
      Installing       : criu-3.10-4.fc28.x86_64                                                                                8/8 
      Running scriptlet: criu-3.10-4.fc28.x86_64                                                                                8/8 
      Verifying        : buildah-1.4-3.git608fa84.fc28.x86_64                                                                   1/8 
      Verifying        : containers-common-0.1.31-13.dev.gite3034e1.fc28.x86_64                                                 2/8 
      Verifying        : ostree-libs-2018.8-1.fc28.x86_64                                                                       3/8 
      Verifying        : runc-2:1.0.0-56.dev.git78ef28e.fc28.x86_64                                                             4/8 
      Verifying        : container-selinux-2:2.74-1.gita62c2db.fc28.noarch                                                      5/8 
      Verifying        : criu-3.10-4.fc28.x86_64                                                                                6/8 
      Verifying        : libnet-1.1.6-15.fc28.x86_64                                                                            7/8 
      Verifying        : protobuf-c-1.3.0-4.fc28.x86_64                                                                         8/8 
    
    Installed:
      buildah.x86_64 1.4-3.git608fa84.fc28                         criu.x86_64 3.10-4.fc28                                          
      container-selinux.noarch 2:2.74-1.gita62c2db.fc28            containers-common.x86_64 0.1.31-13.dev.gite3034e1.fc28           
      libnet.x86_64 1.1.6-15.fc28                                  ostree-libs.x86_64 2018.8-1.fc28                                 
      protobuf-c.x86_64 1.3.0-4.fc28                               runc.x86_64 2:1.0.0-56.dev.git78ef28e.fc28                       
    
    Complete!
    
    [root-172-31-51-21 ~]# curl -LO https://raw.githubusercontent.com/hongkailiu/test-go/master/test_files/docker/Dockerfile.http.txt
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100   300  100   300    0     0   1796      0 --:--:-- --:--:-- --:--:--  1796
    [root-172-31-51-21 ~]# buildah bud --format=docker -f ./Dockerfile.http.txt -t quay.io/hongkailiu/test-go:http-0.0.3 .STEP 1: FROM docker.io/golang:1.11
    Getting image source signatures
    Copying blob sha256:bc9ab73e5b14b9fbd3687a4d8c1f1360533d6ee9ffc3f5ecc6630794b40257b7
     43.21 MiB / 43.21 MiB [====================================================] 1s
    Copying blob sha256:193a6306c92af328dbd41bbbd3200a2c90802624cccfe5725223324428110d7f
     10.24 MiB / 10.24 MiB [====================================================] 0s
    Copying blob sha256:e5c3f8c317dc30af45021092a3d76f16ba7aa1ee5f18fec742c84d4960818580
     4.14 MiB / 4.14 MiB [======================================================] 0s
    Copying blob sha256:a587a86c9dcb9df6584180042becf21e36ecd8b460a761711227b4b06889a005
     47.75 MiB / 47.75 MiB [====================================================] 2s
    Copying blob sha256:1bc310ac474b880a5e4aeec02e6423d1304d137f1a8990074cb3ac6386a0b654
     54.92 MiB / 54.92 MiB [====================================================] 2s
    Copying blob sha256:997731689cfbc58c8e74f2a20079338ce66965a40b21f27169b3d5a45ab61cbd
     121.31 MiB / 121.31 MiB [==================================================] 4s
    Copying blob sha256:202760eb4a0043cd84cd9971c47052617855ff653abec8ae479e89d369afd500
     125 B / 125 B [============================================================] 0s
    Copying config sha256:45e48f60e2681653d4cc88b69f8c5504e0b5ba345cc45948d611b89193f45364
     5.33 KiB / 5.33 KiB [======================================================] 0s
    Writing manifest to image destination
    Storing signatures
    STEP 2: RUN go get -d -v github.com/hongkailiu/test-go/cmd
    container exited on segmentation fault
    error building at step {Env:[PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin GOLANG_VERSION=1.11.1 GOPATH=/go] Command:run Args:[go get -d -v github.com/hongkailiu/test-go/cmd] Flags:[] Attrs:map[] Message:RUN go get -d -v github.com/hongkailiu/test-go/cmd Original:RUN go get -d -v github.com/hongkailiu/test-go/cmd}: exit status 1
    </root>

    Have you checked if the version that you tested with is the same as mine? Thanks.

    点赞 评论 复制链接分享
  • weixin_39615956 weixin_39615956 4月前

    thanks for the follow up. I was using top of tree from upstream master, so the latest development bits. Not sure if you can try those or not. I'll see if I can track down the version you're using and try it too.

    If you've the time a ability to try the test on a VM that's not in AWS, i.e. virt-manager, vmware, etc, it would be good to know if it works for you in that scenario. The VM that I tested on was created by virt-manager fwiw.

    点赞 评论 复制链接分享
  • weixin_39912163 weixin_39912163 4月前

    Thanks,
    For sometime I have not played with fedora as local VM. I will do it when I get the chance.

    Not sure if this is related (in the above dnf command):

    
    Failed to generate binary
    /usr/sbin/semodule:  Failed!
    
    点赞 评论 复制链接分享
  • weixin_39912163 weixin_39912163 4月前

    It hit with the same issue, using the local fedora 28 vm. Tested with this iso

    
    ...
    STEP 2: RUN go get -d -v github.com/hongkailiu/test-go/cmd
    container exited on segmentation fault
    error building at step {Env:[PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin GOLANG_VERSION=1.11.2 GOPATH=/go] Command:run Args:[go get -d -v github.com/hongkailiu/test-go/cmd] Flags:[] Attrs:map[] Message:RUN go get -d -v github.com/hongkailiu/test-go/cmd Original:RUN go get -d -v github.com/hongkailiu/test-go/cmd}: exit status 1
    
    
    
    Installed Packages
    Name         : buildah
    Version      : 1.4
    Release      : 3.git608fa84.fc28
    Arch         : x86_64
    Size         : 13 M
    Source       : buildah-1.4-3.git608fa84.fc28.src.rpm
    Repo         : 
    From repo    : updates
    Summary      : A command line tool used for creating OCI Images
    URL          : https://github.com/containers/buildah
    License      : ASL 2.0
    Description  : The buildah package provides a command line tool which can be used to
                 : * create a working container from scratch
                 : or
                 : * create a working container from an image as a starting point
                 : * mount/umount a working container's root file system for manipulation
                 : * save container's root file system layer to create a new image
                 : * delete a working container or an image
    
    
    
    # history 
        1  shutdown -r down
        2  yum install -y buildah
        3  curl -LO https://raw.githubusercontent.com/hongkailiu/test-go/master/test_files/docker/Dockerfile.http.txt
        4  buildah bud --format=docker -f ./Dockerfile.http.txt -t quay.io/hongkailiu/test-go:http-0.0.3 .STEP 1: FROM docker.io/golang:1.11
        5  yum info buildah
    
    
    点赞 评论 复制链接分享
  • weixin_39615956 weixin_39615956 4月前

    thanks for the verification and the pointers.

    点赞 评论 复制链接分享
  • weixin_39912163 weixin_39912163 4月前

    Yes, same error:

    
    # buildah from docker.io/golang:1.11
    Getting image source signatures
    Copying blob sha256:bc9ab73e5b14b9fbd3687a4d8c1f1360533d6ee9ffc3f5ecc6630794b40257b7
     43.21 MiB / 43.21 MiB [====================================================] 1s
    Copying blob sha256:193a6306c92af328dbd41bbbd3200a2c90802624cccfe5725223324428110d7f
     10.24 MiB / 10.24 MiB [====================================================] 0s
    Copying blob sha256:e5c3f8c317dc30af45021092a3d76f16ba7aa1ee5f18fec742c84d4960818580
     4.14 MiB / 4.14 MiB [======================================================] 0s
    Copying blob sha256:a587a86c9dcb9df6584180042becf21e36ecd8b460a761711227b4b06889a005
     47.75 MiB / 47.75 MiB [====================================================] 2s
    Copying blob sha256:1bc310ac474b880a5e4aeec02e6423d1304d137f1a8990074cb3ac6386a0b654
     54.92 MiB / 54.92 MiB [====================================================] 2s
    Copying blob sha256:87ab348d90cc687a586f07c0fd275335aee1e6e52c1995d1a7ac93fc901333bc
     120.66 MiB / 120.66 MiB [==================================================] 4s
    Copying blob sha256:786bc4873ebcc5cc05c0ff26d6ee3f2b26ada535067d07fc98f3ddb0ef4cd7c5
     124 B / 124 B [============================================================] 0s
    Copying config sha256:d817ad5b9beb8ed09a78819c7d7627679c89a4aca36a3b2d47760695d49d09a0
     5.33 KiB / 5.33 KiB [======================================================] 0s
    Writing manifest to image destination
    Storing signatures
    golang-working-container
    # buildah run golang-working-container /bin/sh
    container exited on segmentation fault
    
    
    # yum info buildah
    Last metadata expiration check: 0:01:33 ago on Fri 09 Nov 2018 02:35:29 AM UTC.
    Installed Packages
    Name         : buildah
    Version      : 1.4
    Release      : 3.git608fa84.fc28
    Arch         : x86_64
    Size         : 13 M
    Source       : buildah-1.4-3.git608fa84.fc28.src.rpm
    Repo         : 
    From repo    : updates
    Summary      : A command line tool used for creating OCI Images
    URL          : https://github.com/containers/buildah
    License      : ASL 2.0
    Description  : The buildah package provides a command line tool which can be used to
                 : * create a working container from scratch
                 : or
                 : * create a working container from an image as a starting point
                 : * mount/umount a working container's root file system for manipulation
                 : * save container's root file system layer to create a new image
                 : * delete a working container or an image
    
    
    点赞 评论 复制链接分享
  • weixin_39615956 weixin_39615956 4月前

    Thanks for verifying . I'm thinking the CMD or possibly the EntryPoint field for the golang image is off inside of the Buildah implementation. Got to dig through that today.

    点赞 评论 复制链接分享
  • weixin_39615956 weixin_39615956 4月前

    after digging further today, it looks like this is an selinux issue on F28. I'm not able to replicate the issue on F29 using the same Buildah version. On your VM that you setup to test, can you do setenforce 0 and then retry the test? Once complete, be sure to do setenforce 1 to turn selinux back on.

    I'm actually seeing the issue with just doing ctr=$(buildah from alpine and then buildah run $ctr ls /etc.

    I'm going to need to track down to see if he can help me figure out what's going on with selinux. But if you could confirm on your vm too if you've time, that would be further corroboration.

    点赞 评论 复制链接分享
  • weixin_39912163 weixin_39912163 4月前

    You are correct. With selinux disabled, everything works. My original dockerfile works too. Probably I need to update to F29. SeLinux also caused the same problem for this issue that I just reported earlier today. https://github.com/containers/libpod/issues/1796 Thanks a lot.

    点赞 评论 复制链接分享
  • weixin_39961943 weixin_39961943 4月前

    I think this could be a labeling issue or a container-selinux issue.

    Make sure content in /var/lib/containers is labeled correctly restorecon -R -v /var/lib/containers Also make sure container-selinux installed correctly.

    dnf -y reinstall container-selinux

    点赞 评论 复制链接分享
  • weixin_39615956 weixin_39615956 4月前

    Thanks . The restorecon didn't do the trick. However I did:

    
    dnf -y remove container-selinux
    rm -rf /var/lib/containers
    dnf -y install container-selinux
    

    and things work fine. The version of container-selinux didn't change, but something functionally sure did. I'm going to close this issue. thanks again for the report and follow on tests/debugging that you did afterwards. If you still continue to have similar issues, please reopen this or create a new issue as you feel is appropriate.

    点赞 评论 复制链接分享
  • weixin_39912163 weixin_39912163 4月前

    Thanks for helping figure it out.

    点赞 评论 复制链接分享