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

[bug] build rpm failed #1454

Closed
soarpenguin opened this issue Jun 2, 2018 · 5 comments
Closed

[bug] build rpm failed #1454

soarpenguin opened this issue Jun 2, 2018 · 5 comments
Assignees
Labels
kind/bug This is bug report for project

Comments

@soarpenguin
Copy link
Contributor

soarpenguin commented Jun 2, 2018

Ⅰ. Issue Description

when i run to build rpm package. failed with info:

Step 12/12 : ENTRYPOINT bash -x /go/src/github.com/alibaba/pouch/hack/package/rpm/build.sh
---> Running in 53d4077f2b05
---> 4f10c3e4b57e
Removing intermediate container 53d4077f2b05
Successfully built 4f10c3e4b57e

  • set -e
    ++ mktemp -d /tmp/pouch.XXXXXX
  • TMP=/tmp/pouch.ZXREWs
  • whoami
    root
  • MOUNTDIR=/root/rpm
  • PACKAGEDIR=/root/rpm/package/rpm
  • '[' -d /root/rpm/package/rpm ']'
  • mkdir -p /root/rpm/package/rpm
    mkdir: cannot create directory '/root/rpm/package': Permission denied

Ⅱ. Describe what happened

$ sudo ./hack/package/package.sh 1.0.0 1.el7.centos /root/test rpm
Sending build context to Docker daemon 132.8 MB
Step 1/12 : FROM centos:7.2.1511
---> 0a2bad7da9b5
Step 2/12 : RUN yum clean all && rpm --rebuilddb && yum install -y wget git gcc ruby-devel fuse fuse-devel pam-devel automake autoconf libtool make rpm-build rpm-sign rubygems vim tree && yum clean all
---> Using cache
---> b97fb342316c
Step 3/12 : RUN gem install --no-ri --no-rdoc fpm
---> Using cache
---> ae26fce5492c
Step 4/12 : ENV GO_VERSION 1.9.1
---> Using cache
---> 5279992c4c5c
Step 5/12 : ENV ARCH amd64
---> Using cache
---> 7b61954a3ecd
Step 6/12 : RUN wget --quiet https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${ARCH}.tar.gz && tar -C /usr/local -xzf go${GO_VERSION}.linux-${ARCH}.tar.gz && rm go${GO_VERSION}.linux-${ARCH}.tar.gz
---> Using cache
---> b6d22d3a17fa
Step 7/12 : RUN mkdir /go
---> Using cache
---> fc9cb7f44179
Step 8/12 : ENV GOPATH /go
---> Using cache
---> d88c68bf9d84
Step 9/12 : ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
---> Using cache
---> 728f60628bc3
Step 10/12 : COPY . /go/src/github.com/alibaba/pouch
---> b1ac62ee9658
Removing intermediate container 7a12b3183a81
Step 11/12 : WORKDIR /go/src/github.com/alibaba/pouch/hack/package/rpm
---> d17eb2371631
Removing intermediate container 5c6ead91c6a8
Step 12/12 : ENTRYPOINT bash -x /go/src/github.com/alibaba/pouch/hack/package/rpm/build.sh
---> Running in 53d4077f2b05
---> 4f10c3e4b57e
Removing intermediate container 53d4077f2b05
Successfully built 4f10c3e4b57e

  • set -e
    ++ mktemp -d /tmp/pouch.XXXXXX
  • TMP=/tmp/pouch.ZXREWs
    + whoami
    root
  • MOUNTDIR=/root/rpm
  • PACKAGEDIR=/root/rpm/package/rpm
  • '[' -d /root/rpm/package/rpm ']'
  • mkdir -p /root/rpm/package/rpm
    mkdir: cannot create directory '/root/rpm/package': Permission denied

Ⅲ. Describe what you expected to happen

Ⅳ. How to reproduce it (as minimally and precisely as possible)

Ⅴ. Anything else we need to know?

Ⅵ. Environment:

@pouchrobot pouchrobot added the kind/bug This is bug report for project label Jun 2, 2018
@zzchun
Copy link
Contributor

zzchun commented Jun 4, 2018

@soarpenguin /root/rpm is a directory of your host, while building rpm package, the directory will be mount to a container to save rpm package. So, make sure user root have write access.

@soarpenguin
Copy link
Contributor Author

opened the bash debug info, user root have write access.

sudo ./hack/package/package.sh 1.0.0 1.el7.centos /root/test rpm
/home/soarpenguin/programs/golib/src/github.com/alibaba/pouch /home/soarpenguin/programs/golib/src/github.com/alibaba/pouch
Sending build context to Docker daemon 132.8 MB
Step 1/12 : FROM centos:7.2.1511
---> 0a2bad7da9b5
Step 2/12 : RUN yum clean all && rpm --rebuilddb && yum install -y wget git gcc ruby-devel fuse fuse-devel pam-devel automake autoconf libtool make rpm-build rpm-sign rubygems vim tree && yum clean all
---> Using cache
---> b97fb342316c
Step 3/12 : RUN gem install --no-ri --no-rdoc fpm
---> Using cache
---> ae26fce5492c
Step 4/12 : ENV GO_VERSION 1.9.1
---> Using cache
---> 5279992c4c5c
Step 5/12 : ENV ARCH amd64
---> Using cache
---> 7b61954a3ecd
Step 6/12 : RUN wget --quiet https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${ARCH}.tar.gz && tar -C /usr/local -xzf go${GO_VERSION}.linux-${ARCH}.tar.gz && rm go${GO_VERSION}.linux-${ARCH}.tar.gz
---> Using cache
---> b6d22d3a17fa
Step 7/12 : RUN mkdir /go
---> Using cache
---> fc9cb7f44179
Step 8/12 : ENV GOPATH /go
---> Using cache
---> d88c68bf9d84
Step 9/12 : ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
---> Using cache
---> 728f60628bc3
Step 10/12 : COPY . /go/src/github.com/alibaba/pouch
---> f2d02d5b4018
Removing intermediate container 16d331d74945
Step 11/12 : WORKDIR /go/src/github.com/alibaba/pouch/hack/package/rpm
---> f6696c1c431d
Removing intermediate container 574c7f44f558
Step 12/12 : ENTRYPOINT bash -x /go/src/github.com/alibaba/pouch/hack/package/rpm/build.sh
---> Running in b2e5be690489
---> e2113b4ab320
Removing intermediate container b2e5be690489
Successfully built e2113b4ab320

  • set -e
    ++ mktemp -d /tmp/pouch.XXXXXX
  • TMP=/tmp/pouch.ENtISZ
  • MOUNTDIR=/root/rpm
  • PACKAGEDIR=/root/rpm/package/rpm
  • ls -l /root/
    total 8
    -rw-------. 1 root root 2710 Dec 15 2015 anaconda-ks.cfg
    drwxr-xr-x. 2 root root 4096 Jun 2 08:37 rpm
  • chmod 775 /root/rpm
    chmod: changing permissions of '/root/rpm': Permission denied

@zzchun
Copy link
Contributor

zzchun commented Jun 19, 2018

As what you described you got two different errors, firstly failed to create '/root/rpm', and then failed to change it's permission. I think the reason is that you didn't run the command by "root" user, you can su to "root" and have a try.
You have built image successfully(imageID is e2113b4ab320) , so you can run the image and then execute the following command manually to make sure you have permissions.

set -e
++ mktemp -d /tmp/pouch.XXXXXX
TMP=/tmp/pouch.ENtISZ
MOUNTDIR=/root/rpm
PACKAGEDIR=/root/rpm/package/rpm
ls -l /root/
total 8
-rw-------. 1 root root 2710 Dec 15 2015 anaconda-ks.cfg
drwxr-xr-x. 2 root root 4096 Jun 2 08:37 rpm
chmod 775 /root/rpm
chmod: changing permissions of '/root/rpm': Permission denied

@soarpenguin
Copy link
Contributor Author

soarpenguin commented Jul 11, 2018

@zzchun same error run the command by "root" user;

`# ./hack/package/package.sh 1.0.0 1.el7.centos /root/test rpm
/home/soarpenguin/programs/golib/src/github.com/alibaba/pouch /home/soarpenguin/programs/golib/src/github.com/alibaba/pouch
Sending build context to Docker daemon 132.8 MB
Step 1/12 : FROM centos:7.2.1511
---> 0a2bad7da9b5
....

---> 1112f81e7484
Removing intermediate container 2c1f89857eb9
Successfully built 1112f81e7484
set -e
mktemp -d /tmp/pouch.XXXXXX
TMP=/tmp/pouch.gf3Qyd
MOUNTDIR=/root/rpm
PACKAGEDIR=/root/rpm/package/rpm
ls -l /root/
total 8
-rw-------. 1 root root 2710 Dec 15 2015 anaconda-ks.cfg
drwxr-xr-x. 2 root root 4096 Jun 2 08:37 rpm
chmod 775 /root/rpm
chmod: changing permissions of '/root/rpm': Permission denied
`

@chuanchang
Copy link
Contributor

@soarpenguin this part codes have been obsoleted, so close this one, please check https://github.com/pouchcontainer/project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is bug report for project
Projects
None yet
Development

No branches or pull requests

4 participants