Portus icon indicating copy to clipboard operation
Portus copied to clipboard

Issue with Portus Deployment using Compose File

Open ajeetraina opened this issue 3 years ago • 5 comments

I am facing issue deploying Portus on https://play-with-docker.com Docker Playground. Look like it is pointing to old repo.

Steps to reproduce:

  1. Clone the Repository
  2. Run docker-compose up -d
$ git clone https://github.com/SUSE/Portus
Cloning into 'Portus'...
remote: Enumerating objects: 38900, done.
remote: Total 38900 (delta 0), reused 0 (delta 0), pack-reused 38900
Receiving objects: 100% (38900/38900), 36.55 MiB | 10.56 MiB/s, done.
Resolving deltas: 100% (18392/18392), done.
[node2] (local) [email protected] ~
$ cd Portus/
[node2] (local) [email protected] ~/Portus
$ docker-compose up -d
Creating network "portus_default" with the default driver
Pulling webpack (kkarczmarczyk/node-yarn:latest)...
latest: Pulling from kkarczmarczyk/node-yarn
f2b6b4884fc8: Pull complete
4fb899b4df21: Pull complete
74eaa8be7221: Pull complete
2d6e98fe4040: Pull complete
452c06dec5fa: Pull complete
7b3c215894de: Pull complete
a5063278fd4d: Pull complete
685e0be9c67c: Pull complete
e28d2d0ed0f3: Pull complete
42c423ae43e5: Pull complete
Digest: sha256:ebaee68e82fec5e5924949b5c8700c6eb4b2ec9954269dc08fdb8ded9629542e
Status: Downloaded newer image for kkarczmarczyk/node-yarn:latest
Pulling db (library/mariadb:10.0.23)...
10.0.23: Pulling from library/mariadb
Image docker.io/library/mariadb:10.0.23 uses outdated schema1 manifest format. Please upgrade to a schema2 image for better future compatibility. More information at https://docs.docker.com/registry/spec/deprecated-schema-v1/
7268d8f794c4: Pull complete
a3ed95caeb02: Pull complete
e5a99361f38c: Pull complete
20b20853e29d: Pull complete
9dbc63cf121f: Pull complete
fdebb5c64c6c: Pull complete
38152cd1ae2a: Pull complete
d7f1267eb179: Pull complete
cb5b075a9692: Pull complete
d65a44f4573e: Pull complete
Digest: sha256:508d6866998ce604ca0a9560da342baf3c67e613372c1431397b12d7d7a59c47
Status: Downloaded newer image for mariadb:10.0.23
Building portus
Step 1/8 : FROM opensuse/ruby:2.6
2.6: Pulling from opensuse/ruby
9d4e8071d0e4: Pull complete
28d4d333ea63: Pull complete
e065b08acc02: Pull complete
Digest: sha256:a442b46c8be4aeec39bbb93a2cea2273f8eb0832707d64834b89edf6e175e66f
Status: Downloaded newer image for opensuse/ruby:2.6
 ---> 11f2fc4678e3
Step 2/8 : MAINTAINER SUSE Containers Team <[email protected]>
 ---> Running in af3ea8bee18b
Removing intermediate container af3ea8bee18b
 ---> 2c462a9b42ca
Step 3/8 : ENV COMPOSE=1
 ---> Running in 4719c999f3ab
Removing intermediate container 4719c999f3ab
 ---> 5467118895be
Step 4/8 : EXPOSE 3000
 ---> Running in 843a15942aa2
Removing intermediate container 843a15942aa2
 ---> 67f40cd235dc
Step 5/8 : WORKDIR /srv/Portus
 ---> Running in dd792f1cbdcb
Removing intermediate container dd792f1cbdcb
 ---> 3203bda178e4
Step 6/8 : COPY Gemfile* ./
 ---> 7a0dd38b6b76
Step 7/8 : RUN zypper addrepo https://download.opensuse.org/repositories/devel:languages:go/openSUSE_Leap_15.0/devel:languages:go.repo &&     zypper addrepo https://download.opensuse.org/repositories/devel:/tools/openSUSE_Leap_15.0/ devel:tools &&     zypper --gpg-auto-import-keys ref &&     zypper -n in --no-recommends ruby2.6-devel            libmariadb-devel postgresql-devel            nodejs libxml2-devel libxslt1 git-core            go1.10 phantomjs gcc-c++ &&     zypper -n in --no-recommends -t pattern devel_basis &&     gem install bundler --no-document -v 1.17.3 &&     update-alternatives --install /usr/bin/bundle bundle /usr/bin/bundle.ruby2.6 3 &&     update-alternatives --install /usr/bin/bundler bundler /usr/bin/bundler.ruby2.6 3 &&     bundle install --retry=3 &&     go get -u github.com/vbatts/git-validation &&     go get -u github.com/openSUSE/portusctl &&     mv /root/go/bin/git-validation /usr/local/bin/ &&     mv /root/go/bin/portusctl /usr/local/bin/ &&     zypper -n rm wicked wicked-service autoconf automake            binutils bison cpp flex gdbm-devel gettext-tools            libtool m4 make makeinfo &&     zypper clean -a
 ---> Running in b1e56cedde63
Adding repository 'The Go Programming Language (openSUSE_Leap_15.0)' [......done]
Repository 'The Go Programming Language (openSUSE_Leap_15.0)' successfully added

URI         : https://download.opensuse.org/repositories/devel:/languages:/go/openSUSE_Leap_15.0/
Enabled     : Yes                                                                                
GPG Check   : Yes                                                                                
Autorefresh : No                                                                                 
Priority    : 99 (default priority)                                                              

Repository priorities are without effect. All enabled repositories share the same priority.
Adding repository 'devel:tools' [......done]
Repository 'devel:tools' successfully added

URI         : https://download.opensuse.org/repositories/devel:/tools/openSUSE_Leap_15.0/
Enabled     : Yes                                                                        
GPG Check   : Yes                                                                        
Autorefresh : No                                                                         
Priority    : 99 (default priority)                                                      

Repository priorities are without effect. All enabled repositories share the same priority.
Retrieving repository 'devel:tools' metadata [.error]
Repository 'devel:tools' is invalid.
[devel:tools|https://download.opensuse.org/repositories/devel:/tools/openSUSE_Leap_15.0/] Valid metadata not found at specified URL
Please check if the URIs defined for this repository are pointing to a valid repository.
Skipping repository 'devel:tools' because of the above error.
Retrieving repository 'The Go Programming Language (openSUSE_Leap_15.0)' metadata [..

Automatically importing the following key:

  Repository:       The Go Programming Language (openSUSE_Leap_15.0)                      
  Key Name:         devel:languages:go OBS Project <devel:languages:[email protected]>
  Key Fingerprint:  B619E7E2 4D0ED061 FA14343C AF4CFE4D 307D7BF9                          
  Key Created:      Wed Jun  3 04:52:51 2020                                              
  Key Expires:      Fri Aug 12 04:52:51 2022                                              
  Rpm Name:         gpg-pubkey-307d7bf9-5ed72ca3                                          


.done]
Building repository 'The Go Programming Language (openSUSE_Leap_15.0)' cache [....done]
Retrieving repository 'openSUSE-Leap-15.0-Non-Oss' metadata [..done]
Building repository 'openSUSE-Leap-15.0-Non-Oss' cache [....done]
Retrieving repository 'openSUSE-Leap-15.0-Oss' metadata [....done]
Building repository 'openSUSE-Leap-15.0-Oss' cache [....done]
Retrieving repository 'openSUSE-Leap-15.0-Update' metadata [........done]
Building repository 'openSUSE-Leap-15.0-Update' cache [....done]
Retrieving repository 'openSUSE-Leap-15.0-Update-Non-Oss' metadata [..done]
Building repository 'openSUSE-Leap-15.0-Update-Non-Oss' cache [....done]
Retrieving repository 'ruby' metadata [.error]
Repository 'ruby' is invalid.
[ruby|https://download.opensuse.org/repositories/devel:/languages:/ruby/openSUSE_Leap_15.0] Valid metadata not found at specified URL
Please check if the URIs defined for this repository are pointing to a valid repository.
Skipping repository 'ruby' because of the above error.
Some of the repositories have not been refreshed because of an error.
ERROR: Service 'portus' failed to build: The command '/bin/sh -c zypper addrepo https://download.opensuse.org/repositories/devel:languages:go/openSUSE_Leap_15.0/devel:languages:go.repo &&     zypper addrepo https://download.opensuse.org/repositories/devel:/tools/openSUSE_Leap_15.0/ devel:tools &&     zypper --gpg-auto-import-keys ref &&     zypper -n in --no-recommends ruby2.6-devel            libmariadb-devel postgresql-devel            nodejs libxml2-devel libxslt1 git-core            go1.10 phantomjs gcc-c++ &&     zypper -n in --no-recommends -t pattern devel_basis &&     gem install bundler --no-document -v 1.17.3 &&     update-alternatives --install /usr/bin/bundle bundle /usr/bin/bundle.ruby2.6 3 &&     update-alternatives --install /usr/bin/bundler bundler /usr/bin/bundler.ruby2.6 3 &&     bundle install --retry=3 &&     go get -u github.com/vbatts/git-validation &&     go get -u github.com/openSUSE/portusctl &&     mv /root/go/bin/git-validation /usr/local/bin/ &&     mv /root/go/bin/portusctl /usr/local/bin/ &&     zypper -n rm wicked wicked-service autoconf automake            binutils bison cpp flex gdbm-devel gettext-tools            libtool m4 make makeinfo &&     zypper clean -a' returned a non-zero code: 4

ajeetraina avatar Aug 23 '20 04:08 ajeetraina

add sed -i 's/15.0/15.1/g' /etc/zypp/repos.d/* to the first line of the RUN command in Dockerfile and change the all 15.0 to 15.1

FROM opensuse/ruby:2.6
MAINTAINER SUSE Containers Team <[email protected]>

ENV COMPOSE=1
EXPOSE 3000

WORKDIR /srv/Portus
COPY Gemfile* ./

# Let's explain this RUN command:
#   1. First of all we add d:l:go repo to get the latest go version.
#   2. Then refresh, since opensuse/ruby does zypper clean -a in the end.
#   3. Then we install dev. dependencies and the devel_basis pattern (used for
#      building stuff like nokogiri). With that we can run bundle install.
#   4. We then proceed to remove unneeded clutter: first we remove some packages
#      installed with the devel_basis pattern, and finally we zypper clean -a.
RUN sed -i 's/15.0/15.1/g' /etc/zypp/repos.d/* && \
    zypper addrepo https://download.opensuse.org/repositories/devel:languages:go/openSUSE_Leap_15.1/devel:languages:go.repo && \
    zypper addrepo https://download.opensuse.org/repositories/devel:/tools/openSUSE_Leap_15.1/ devel:tools && \
    zypper --gpg-auto-import-keys ref && \
    zypper -n in --no-recommends ruby2.6-devel \
           libmariadb-devel postgresql-devel \
           nodejs libxml2-devel libxslt1 git-core \
           go1.10 phantomjs gcc-c++ && \
    zypper -n in --no-recommends -t pattern devel_basis && \
    gem install bundler --no-document -v 1.17.3 && \
    update-alternatives --install /usr/bin/bundle bundle /usr/bin/bundle.ruby2.6 3 && \
    update-alternatives --install /usr/bin/bundler bundler /usr/bin/bundler.ruby2.6 3 && \
    bundle install --retry=3 && \
    go get -u github.com/vbatts/git-validation && \
    go get -u github.com/openSUSE/portusctl && \
    mv /root/go/bin/git-validation /usr/local/bin/ && \
    mv /root/go/bin/portusctl /usr/local/bin/ && \
    zypper -n rm wicked wicked-service autoconf automake \
           binutils bison cpp flex gdbm-devel gettext-tools \
           libtool m4 make makeinfo && \
    zypper clean -a

ADD . .

ehsanrocket avatar Oct 15 '20 07:10 ehsanrocket

It still fails:

uilding repository 'The Go Programming Language (openSUSE_Leap_15.1)' cache [....done]
Retrieving repository 'openSUSE-Leap-15.0-Non-Oss' metadata [..done]
Building repository 'openSUSE-Leap-15.0-Non-Oss' cache [....done]
Retrieving repository 'openSUSE-Leap-15.0-Oss' metadata [...done]
Building repository 'openSUSE-Leap-15.0-Oss' cache [....done]
Retrieving repository 'openSUSE-Leap-15.0-Update' metadata [....done]
Building repository 'openSUSE-Leap-15.0-Update' cache [....done]
Retrieving repository 'openSUSE-Leap-15.0-Update-Non-Oss' metadata [..done]
Building repository 'openSUSE-Leap-15.0-Update-Non-Oss' cache [....done]
Retrieving repository 'ruby' metadata [.error]
Repository 'ruby' is invalid.
[ruby|https://download.opensuse.org/repositories/devel:/languages:/ruby/openSUSE_Leap_15.0] Valid metadata not found at specified URL
Please check if the URIs defined for this repository are pointing to a valid repository.
Skipping repository 'ruby' because of the above error.
Some of the repositories have not been refreshed because of an error.
ERROR: Service 'portus' failed to build: The command '/bin/sh -c zypper addrepo https://download.opensuse.org/repositories/devel:languages:go/openSUSE_Leap_15.1/devel:languages:go.repo &&     zypper addrepo https://download.opensuse.org/repositories/devel:/tools/openSUSE_Leap_15.1/ devel:tools &&     zypper --gpg-auto-import-keys ref &&     zypper -n in --no-recommends ruby2.6-devel            libmariadb-devel postgresql-devel            nodejs libxml2-devel libxslt1 git-core            go1.10 phantomjs gcc-c++ &&     zypper -n in --no-recommends -t pattern devel_basis &&     gem install bundler --no-document -v 1.17.3 &&     update-alternatives --install /usr/bin/bundle bundle /usr/bin/bundle.ruby2.6 3 &&     update-alternatives --install /usr/bin/bundler bundler /usr/bin/bundler.ruby2.6 3 &&     bundle install --retry=3 &&     go get -u github.com/vbatts/git-validation &&     go get -u github.com/openSUSE/portusctl &&     mv /root/go/bin/git-validation /usr/local/bin/ &&     mv /root/go/bin/portusctl /usr/local/bin/ &&     zypper -n rm wicked wicked-service autoconf automake            binutils bison cpp flex gdbm-devel gettext-tools            libtool m4 make makeinfo &&     zypper clean -a' returned a non-zero code: 4


I will try to add zypper update and see if it works.

collabnix avatar Oct 18 '20 02:10 collabnix

add sed -i 's/15.0/15.1/g' /etc/zypp/repos.d/* to the first line of the RUN command in Dockerfile and change the all 15.0 to 15.1

FROM opensuse/ruby:2.6
MAINTAINER SUSE Containers Team <[email protected]>

ENV COMPOSE=1
EXPOSE 3000

WORKDIR /srv/Portus
COPY Gemfile* ./

# Let's explain this RUN command:
#   1. First of all we add d:l:go repo to get the latest go version.
#   2. Then refresh, since opensuse/ruby does zypper clean -a in the end.
#   3. Then we install dev. dependencies and the devel_basis pattern (used for
#      building stuff like nokogiri). With that we can run bundle install.
#   4. We then proceed to remove unneeded clutter: first we remove some packages
#      installed with the devel_basis pattern, and finally we zypper clean -a.
RUN sed -i 's/15.0/15.1/g' /etc/zypp/repos.d/* && \
    zypper addrepo https://download.opensuse.org/repositories/devel:languages:go/openSUSE_Leap_15.1/devel:languages:go.repo && \
    zypper addrepo https://download.opensuse.org/repositories/devel:/tools/openSUSE_Leap_15.1/ devel:tools && \
    zypper --gpg-auto-import-keys ref && \
    zypper -n in --no-recommends ruby2.6-devel \
           libmariadb-devel postgresql-devel \
           nodejs libxml2-devel libxslt1 git-core \
           go1.10 phantomjs gcc-c++ && \
    zypper -n in --no-recommends -t pattern devel_basis && \
    gem install bundler --no-document -v 1.17.3 && \
    update-alternatives --install /usr/bin/bundle bundle /usr/bin/bundle.ruby2.6 3 && \
    update-alternatives --install /usr/bin/bundler bundler /usr/bin/bundler.ruby2.6 3 && \
    bundle install --retry=3 && \
    go get -u github.com/vbatts/git-validation && \
    go get -u github.com/openSUSE/portusctl && \
    mv /root/go/bin/git-validation /usr/local/bin/ && \
    mv /root/go/bin/portusctl /usr/local/bin/ && \
    zypper -n rm wicked wicked-service autoconf automake \
           binutils bison cpp flex gdbm-devel gettext-tools \
           libtool m4 make makeinfo && \
    zypper clean -a

ADD . .

Worked for me on master

kev-byte avatar Jan 22 '21 02:01 kev-byte

Thanks for all your contributions! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Jan 09 '22 04:01 stale[bot]

same trouble here...

brunolabozzetta avatar Mar 28 '23 21:03 brunolabozzetta