pokusio / opensuzie-oci-library

OCI image library of Pokus' Devops factory for running https://github.com/SUSE/Portus, built upon fixes for https://github.com/openSUSE/docker-containers
1 stars 0 forks source link

Repair /init script env. var mangement (but it was ruby installation repaired) #1

Open Jean-Baptiste-Lasselle opened 4 years ago

Jean-Baptiste-Lasselle commented 4 years ago

Please follow the general troubleshooting steps first:

Yes, version 0.0.1

# write the line of your little script here (don't forget the shebang)
I use a automated recipe not published yet, will be published soon
background_1                        | /usr/bin/bundle:23:in `load': cannot load such file -- /usr/lib64/ruby/gems/2.6.0/gems/bundler-1.16.4/exe/bundle (LoadError)
background_1                        |   from /usr/bin/bundle:23:in `<main>'

But there is that very strange thing I noticed

And that, I note to bear it in mind :

portuscontainer                     | + export RACK_ENV=production
portuscontainer                     | + RACK_ENV=production
portuscontainer                     | + export RAILS_ENV=production
portuscontainer                     | + RAILS_ENV=production
portuscontainer                     | + export CCONFIG_PREFIX=PORTUS
portuscontainer                     | + CCONFIG_PREFIX=PORTUS
portuscontainer                     | + '[' -z '' ']'
portuscontainer                     | + export GEM_PATH=/srv/Portus/vendor/bundle/ruby/2.5.3
portuscontainer                     | + GEM_PATH=/srv/Portus/vendor/bundle/ruby/2.5.3
if [ -z "$PORTUS_GEM_GLOBAL" ]; then
    export GEM_PATH="/srv/Portus/vendor/bundle/ruby/2.6.0"
fi

I guess I have my tomorrow 's TODO List.

The logs from my portus and background services (and the /init script)

using my portus:2.5 repaired image

jibl@poste-devops-typique:~/portus.autopilot.provision.XXXXXX/portus/official/compose/examples/compose$ docker-compose logs -f portus|more
Attaching to portuscontainer
portuscontainer                     | + mkdir -p /secrets/certificates
portuscontainer                     | + mkdir -p /secrets/rails
portuscontainer                     | ++++++++++++++++++++++++++
portuscontainer                     | ++++++++++++++++++++++++++
portuscontainer                     | ++++++++++++++++++++++++++
portuscontainer                     | PORTUS PKI-INIT
portuscontainer                     | ++++++++++++++++++++++++++
portuscontainer                     | ++++++++++++++++++++++++++
portuscontainer                     | ++++++++++++++++++++++++++
portuscontainer                     | + echo ++++++++++++++++++++++++++
portuscontainer                     | + echo ++++++++++++++++++++++++++
portuscontainer                     | + echo ++++++++++++++++++++++++++
portuscontainer                     | + echo 'PORTUS PKI-INIT'
portuscontainer                     | + echo ++++++++++++++++++++++++++
portuscontainer                     | + echo ++++++++++++++++++++++++++
portuscontainer                     | + echo ++++++++++++++++++++++++++
portuscontainer                     | + set -x
portuscontainer                     | + mkdir -p /certificates
portuscontainer                     | + cp /secrets/certificates/portus.crt /certificates
portuscontainer                     | + cp /secrets/certificates/portus-oci-registry.crt /certificates
portuscontainer                     | + cp /secrets/certificates/portus-background.crt /certificates
portuscontainer                     | + update-ca-certificates
portuscontainer                     | + set -e
portuscontainer                     | + secrets=(PORTUS_DB_PASSWORD PORTUS_PASSWORD PORTUS_SECRET_KEY_BAS
E PORTUS_EMAIL_SMTP_PASSWORD PORTUS_LDAP_AUTHENTICATION_PASSWORD)
portuscontainer                     | + for s in "${secrets[@]}"
portuscontainer                     | + [[ -z portus ]]
portuscontainer                     | + for s in "${secrets[@]}"
portuscontainer                     | + [[ -z 12341234 ]]
portuscontainer                     | + for s in "${secrets[@]}"
portuscontainer                     | + [[ -z '' ]]
portuscontainer                     | + file_env PORTUS_SECRET_KEY_BASE
portuscontainer                     | + local var=PORTUS_SECRET_KEY_BASE
portuscontainer                     | + local fileVar=PORTUS_SECRET_KEY_BASE_FILE
portuscontainer                     | + local def=
portuscontainer                     | + '[' '' ']'
portuscontainer                     | + local val=
portuscontainer                     | + '[' '' ']'
portuscontainer                     | + '[' /secrets/rails/portus.secret.key.base ']'
portuscontainer                     | + val=4e779b234f79de439e962b1f07991de41fe4baf611625545b5513405b7036
c67bd5e7a63719c1e917d84edc2f81bda6ebe643f52fd6aabbb97a4825dee07943a
portuscontainer                     | + export PORTUS_SECRET_KEY_BASE=4e779b234f79de439e962b1f07991de41fe
4baf611625545b5513405b7036c67bd5e7a63719c1e917d84edc2f81bda6ebe643f52fd6aabbb97a4825dee07943a
portuscontainer                     | + PORTUS_SECRET_KEY_BASE=4e779b234f79de439e962b1f07991de41fe4baf611
625545b5513405b7036c67bd5e7a63719c1e917d84edc2f81bda6ebe643f52fd6aabbb97a4825dee07943a
portuscontainer                     | + unset PORTUS_SECRET_KEY_BASE_FILE
portuscontainer                     | + for s in "${secrets[@]}"
portuscontainer                     | + [[ -z '' ]]
portuscontainer                     | + file_env PORTUS_EMAIL_SMTP_PASSWORD
portuscontainer                     | + local var=PORTUS_EMAIL_SMTP_PASSWORD
portuscontainer                     | + local fileVar=PORTUS_EMAIL_SMTP_PASSWORD_FILE
portuscontainer                     | + local def=
portuscontainer                     | + '[' '' ']'
portuscontainer                     | + local val=
portuscontainer                     | + '[' '' ']'
portuscontainer                     | + '[' '' ']'
portuscontainer                     | + export PORTUS_EMAIL_SMTP_PASSWORD=
portuscontainer                     | + PORTUS_EMAIL_SMTP_PASSWORD=
portuscontainer                     | + unset PORTUS_EMAIL_SMTP_PASSWORD_FILE
portuscontainer                     | + for s in "${secrets[@]}"
portuscontainer                     | + [[ -z '' ]]
portuscontainer                     | + file_env PORTUS_LDAP_AUTHENTICATION_PASSWORD
portuscontainer                     | + local var=PORTUS_LDAP_AUTHENTICATION_PASSWORD
portuscontainer                     | + local fileVar=PORTUS_LDAP_AUTHENTICATION_PASSWORD_FILE
portuscontainer                     | + local def=
portuscontainer                     | + '[' '' ']'
portuscontainer                     | + local val=
portuscontainer                     | + '[' '' ']'
portuscontainer                     | + '[' '' ']'
portuscontainer                     | + export PORTUS_LDAP_AUTHENTICATION_PASSWORD=
portuscontainer                     | + PORTUS_LDAP_AUTHENTICATION_PASSWORD=
portuscontainer                     | + unset PORTUS_LDAP_AUTHENTICATION_PASSWORD_FILE
portuscontainer                     | + update-ca-certificates
portuscontainer                     | + export PORTUS_PUMA_HOST=0.0.0.0:3000
portuscontainer                     | + PORTUS_PUMA_HOST=0.0.0.0:3000
portuscontainer                     | + export RACK_ENV=production
portuscontainer                     | + RACK_ENV=production
portuscontainer                     | + export RAILS_ENV=production
portuscontainer                     | + RAILS_ENV=production
portuscontainer                     | + export CCONFIG_PREFIX=PORTUS
portuscontainer                     | + CCONFIG_PREFIX=PORTUS
portuscontainer                     | + '[' -z '' ']'
portuscontainer                     | + export GEM_PATH=/srv/Portus/vendor/bundle/ruby/2.5.3
portuscontainer                     | + GEM_PATH=/srv/Portus/vendor/bundle/ruby/2.5.3
portuscontainer                     | + '[' debug == debug ']'
portuscontainer                     | + printenv
portuscontainer                     | PORTUS_DB_PASSWORD=portus
portuscontainer                     | PORTUS_DB_HOST=db
portuscontainer                     | HOSTNAME=b586460b2733
portuscontainer                     | PORTUS_SECURITY_CLAIR_SERVER=http://clair.pegasusio.io:6060
portuscontainer                     | RAILS_SERVE_STATIC_ASSETS='true'
portuscontainer                     | PORTUS_DB_POOL=5
portuscontainer                     | CCONFIG_PREFIX=PORTUS
portuscontainer                     | PORTUS_KEY_PATH=/secrets/certificates/portus.key
portuscontainer                     | PORTUS_LDAP_AUTHENTICATION_PASSWORD=
portuscontainer                     | PWD=/
portuscontainer                     | PORTUS_PUMA_HOST=0.0.0.0:3000
portuscontainer                     | HOME=/root
portuscontainer                     | PORTUS_MACHINE_FQDN_VALUE=portus.pegasusio.io
portuscontainer                     | RAILS_SERVE_STATIC_FILES='true'
portuscontainer                     | PORTUS_EMAIL_SMTP_PASSWORD=
portuscontainer                     | GEM_PATH=/srv/Portus/vendor/bundle/ruby/2.5.3
portuscontainer                     | PORTUS_SECURITY_CLAIR_HEALTH_PORT=6061
portuscontainer                     | RAILS_ENV=production
portuscontainer                     | PORTUS_PASSWORD=12341234
portuscontainer                     | PORTUS_SECRET_KEY_BASE=4e779b234f79de439e962b1f07991de41fe4baf61162
5545b5513405b7036c67bd5e7a63719c1e917d84edc2f81bda6ebe643f52fd6aabbb97a4825dee07943a
portuscontainer                     | RACK_ENV=production
portuscontainer                     | PORTUS_SERVICE_FQDN_VALUE=portus.pegasusio.io
portuscontainer                     | PORTUS_LOG_LEVEL=debug
portuscontainer                     | PORTUS_PUMA_TLS_CERT=/secrets/certificates/portus.crt
portuscontainer                     | PORTUS_SECURITY_CLAIR_TIMEOUT=900s
portuscontainer                     | SHLVL=2
portuscontainer                     | PORTUS_PUMA_TLS_KEY=/secrets/certificates/portus.key
portuscontainer                     | PORTUS_DB_DATABASE=portus_production
portuscontainer                     | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
portuscontainer                     | _=/usr/bin/printenv
portuscontainer                     | + cd /srv/Portus
portuscontainer                     | + '[' '!' -z '' ']'
portuscontainer                     | + '[' -z '' ']'
portuscontainer                     | + setup_database
portuscontainer                     | + wait_for_database 1
portuscontainer                     | + should_setup=1
portuscontainer                     | + TIMEOUT=90
portuscontainer                     | + COUNT=0
portuscontainer                     | + RETRY=1
portuscontainer                     | + '[' 1 -ne 0 ']'
portuscontainer                     | + case $(portusctl exec rails r /srv/Portus/bin/check_db.rb | grep 
DB) in
portuscontainer                     | ++ portusctl exec rails r /srv/Portus/bin/check_db.rb
portuscontainer                     | ++ grep DB
portuscontainer                     | [WARN] couldn't connect to database. Skipping PublicActivity::Activ
ity#parameters's serialization
portuscontainer                     | Waiting for mariadb to be ready in 5 seconds
portuscontainer                     | + '[' 0 -ge 90 ']'
portuscontainer                     | + echo 'Waiting for mariadb to be ready in 5 seconds'
portuscontainer                     | + sleep 5
portuscontainer                     | + COUNT=5
portuscontainer                     | + '[' 1 -ne 0 ']'
portuscontainer                     | + case $(portusctl exec rails r /srv/Portus/bin/check_db.rb | grep 
DB) in
portuscontainer                     | ++ grep DB
portuscontainer                     | ++ portusctl exec rails r /srv/Portus/bin/check_db.rb
portuscontainer                     | [WARN] table PublicActivity::ORM::ActiveRecord::Activity doesn't ex
ist. Skipping PublicActivity::Activity#parameters's serialization
portuscontainer                     | + '[' 1 -eq 1 ']'
portuscontainer                     | + echo 'Initializing database'
portuscontainer                     | + portusctl exec rake db:setup
portuscontainer                     | Initializing database
portuscontainer                     | [WARN] table PublicActivity::ORM::ActiveRecord::Activity doesn't ex
ist. Skipping PublicActivity::Activity#parameters's serialization
portuscontainer                     | Database 'portus_production' already exists
portuscontainer                     | [schema] Selected the schema for mysql
portuscontainer                     |    (0.3ms)  SET NAMES utf8,  @@SESSION.sql_mode = 
CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'),  @@SESSION.sql_auto_is_null = 0, @@S
ESSION.wait_timeout = 2147483
portuscontainer                     | [Mailer config] Host:     portus.pegasusio.io
portuscontainer                     | [Mailer config] Protocol: https://
portuscontainer                     |    (0.3ms)  SET NAMES utf8,  @@SESSION.sql_mode = 
CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'),  @@SESSION.sql_auto_is_null = 0, @@S
ESSION.wait_timeout = 2147483
jibl@poste-devops-typique:~/portus.autopilot.provision.XXXXXX/portus/official/compose/examples/compose$ docker-compose logs -f background|more
Attaching to compose_background_1
background_1                        | ++++++++++++++++++++++++++
background_1                        | ++++++++++++++++++++++++++
background_1                        | ++++++++++++++++++++++++++
background_1                        | PORTUS BACKGROUND PKI-INIT
background_1                        | ++++++++++++++++++++++++++
background_1                        | ++++++++++++++++++++++++++
background_1                        | ++++++++++++++++++++++++++
background_1                        | + mkdir -p /certificates
background_1                        | + cp /secrets/certificates/portus.crt /certificates
background_1                        | + cp /secrets/certificates/portus-oci-registry.crt /certificates
background_1                        | + cp /secrets/certificates/portus-background.crt /certificates
background_1                        | + update-ca-certificates
background_1                        | PORTUS_DB_PASSWORD=portus
background_1                        | PORTUS_DB_HOST=db
background_1                        | HOSTNAME=694ac5463bed
background_1                        | PORTUS_SECURITY_CLAIR_SERVER=http://clair.pegasusio.io:6060
background_1                        | PORTUS_DB_POOL=5
background_1                        | CCONFIG_PREFIX=PORTUS
background_1                        | PORTUS_KEY_PATH=/secrets/certificates/portus-background.key
background_1                        | PWD=/
background_1                        | PORTUS_PUMA_HOST=0.0.0.0:3000
background_1                        | HOME=/root
background_1                        | PORTUS_MACHINE_FQDN_VALUE=portus.pegasusio.io
background_1                        | GEM_PATH=/srv/Portus/vendor/bundle/ruby/2.6.0
background_1                        | PORTUS_SECURITY_CLAIR_HEALTH_PORT=6061
background_1                        | RAILS_ENV=production
background_1                        | PORTUS_PASSWORD=12341234
background_1                        | PORTUS_SECRET_KEY_BASE=4e779b234f79de439e962b1f07991de41fe4baf61162
5545b5513405b7036c67bd5e7a63719c1e917d84edc2f81bda6ebe643f52fd6aabbb97a4825dee07943a
background_1                        | RACK_ENV=production
background_1                        | PORTUS_LOG_LEVEL=debug
background_1                        | PORTUS_SECURITY_CLAIR_TIMEOUT=900s
background_1                        | SHLVL=2
background_1                        | PORTUS_DB_DATABASE=portus_production
background_1                        | PORTUS_BACKGROUND=true
background_1                        | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
background_1                        | _=/usr/bin/printenv
background_1                        | [WARN] couldn't connect to database. Skipping PublicActivity::Activ
ity#parameters's serialization
background_1                        | Waiting for mariadb to be ready in 5 seconds
background_1                        | [WARN] table PublicActivity::ORM::ActiveRecord::Activity doesn't ex
ist. Skipping PublicActivity::Activity#parameters's serialization
background_1                        | /usr/bin/bundle:23:in `load': cannot load such file -- /usr/lib64/r
uby/gems/2.6.0/gems/bundler-1.16.4/exe/bundle (LoadError)
background_1                        |   from /usr/bin/bundle:23:in `
' background_1 | Database ready background_1 | [schema] Selected the schema for mysql background_1 | (0.4ms) SET NAMES utf8, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@S ESSION.wait_timeout = 2147483 background_1 | [Mailer config] Host: portus.pegasusio.io background_1 | [Mailer config] Protocol: https:// background_1 | User Exists (0.4ms) SELECT 1 AS one FROM `user s` WHERE `users`.`username` = 'portus' LIMIT 1 background_1 | User Load (0.5ms) SELECT `users`.* FROM `users ` WHERE `users`.`username` = 'portus' LIMIT 1 background_1 | (0.4ms) BEGIN background_1 | User Update (0.5ms) UPDATE `users` SET `encrypt ed_password` = '$2a$10$EYWWJKtYCLV2MWePMBEa1OTnss/pdtX/s1znYb6jWKc1lhJJJ119.', `updated_at` = '2020-03-01 04:31: 16' WHERE `users`.`id` = 1 background_1 | (0.3ms) COMMIT --Plus--

Now is the most interesting thing :

background_1                        | GEM_PATH=/srv/Portus/vendor/bundle/ruby/2.5.0
background_1                        | RAILS_ENV=production
background_1                        | RACK_ENV=production
jibl@poste-devops-typique:~/portus.autopilot.provision.XXXXXX/portus/official/compose/examples/compose$ docker-compose logs -f background|more
Attaching to compose_background_1
background_1                        | + mkdir -p /certificates
background_1                        | ++++++++++++++++++++++++++
background_1                        | ++++++++++++++++++++++++++
background_1                        | ++++++++++++++++++++++++++
background_1                        | PORTUS BACKGROUND PKI-INIT
background_1                        | ++++++++++++++++++++++++++
background_1                        | ++++++++++++++++++++++++++
background_1                        | ++++++++++++++++++++++++++
background_1                        | + cp /secrets/certificates/portus.crt /certificates
background_1                        | + cp /secrets/certificates/portus-oci-registry.crt /certificates
background_1                        | + cp /secrets/certificates/portus-background.crt /certificates
background_1                        | + update-ca-certificates
background_1                        | PORTUS_DB_PASSWORD=portus
background_1                        | PORTUS_DB_HOST=db
background_1                        | HOSTNAME=1f8001b2a341
background_1                        | PORTUS_SECURITY_CLAIR_SERVER=http://clair.pegasusio.io:6060
background_1                        | PORTUS_DB_POOL=5
background_1                        | CCONFIG_PREFIX=PORTUS
background_1                        | PORTUS_KEY_PATH=/secrets/certificates/portus-background.key
background_1                        | PORTUS_LDAP_AUTHENTICATION_PASSWORD=
background_1                        | PWD=/
background_1                        | PORTUS_PUMA_HOST=0.0.0.0:3000
background_1                        | HOME=/root
background_1                        | PORTUS_MACHINE_FQDN_VALUE=portus.pegasusio.io
background_1                        | PORTUS_EMAIL_SMTP_PASSWORD=
background_1                        | GEM_PATH=/srv/Portus/vendor/bundle/ruby/2.5.0
background_1                        | PORTUS_SECURITY_CLAIR_HEALTH_PORT=6061
background_1                        | RAILS_ENV=production
background_1                        | PORTUS_PASSWORD=12341234
background_1                        | PORTUS_SECRET_KEY_BASE=19af1ad1d3c58649ca6bf1ca4514f22388660855df6c
f82d368f4d869554bf62de5bd92b273f7c6ed470961c510da7fda483ffb162b58cfb87b474bd9909fe08
background_1                        | RACK_ENV=production
background_1                        | PORTUS_LOG_LEVEL=debug
background_1                        | PORTUS_SECURITY_CLAIR_TIMEOUT=900s
background_1                        | SHLVL=2
background_1                        | PORTUS_DB_DATABASE=portus_production
background_1                        | PORTUS_BACKGROUND=true
background_1                        | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
background_1                        | _=/usr/bin/printenv
background_1                        | [Mailer config] Host:     portus.pegasusio.io
background_1                        | [Mailer config] Protocol: https://
background_1                        |   User Exists (0.2ms)  SELECT  1 AS one FROM `users` W
HERE `users`.`username` = 'portus' LIMIT 1
background_1                        |   User Load (0.5ms)  SELECT  `users`.* FROM `users` WHERE
 `users`.`username` = 'portus' LIMIT 1
background_1                        |    (0.2ms)  BEGIN
background_1                        |   SQL (0.4ms)  UPDATE `users` SET `encrypted_password` = 
'$2a$10$Cz7bYma5FEaaEH1QeuP6qeiCL7PSwZ29q8QPvvm6Xj.MT.GugcSm6', `updated_at` = '2020-03-01 07:47:19' WHERE `user
s`.`id` = 1
background_1                        |    (0.3ms)  COMMIT
background_1                        |   User Exists (0.3ms)  SELECT  1 AS one FROM `users` WHER
E `users`.`username` = 'portus' LIMIT 1
background_1                        |    (0.1ms)  SELECT COUNT(*) FROM `registries`
background_1                        |    (0.4ms)  SELECT COUNT(*) FROM `repositories`
background_1                        | [Initialization] Running: 'Registry events', 'Security scanning', '
Registry synchronization'
background_1                        |   RegistryEvent Load (0.4ms)  SELECT  `registry_events
`.* FROM `registry_events` WHERE `registry_events`.`status` = 2  ORDER BY `registry_events`.`id` ASC LIMIT 1000
0m
background_1                        |   Tag Exists (0.6ms)  SELECT  1 AS one FROM `tags` WHERE 
`tags`.`scanned` = 0 LIMIT 1
background_1                        |    (0.3ms)  SELECT COUNT(*) FROM `repositories`
background_1                        |   Registry Load (0.4ms)  SELECT  `registries`.* FROM `reg
istries`  ORDER BY `registries`.`id` ASC LIMIT 1000
background_1                        |   RegistryEvent Load (0.3ms)  SELECT  `registry_events
`.* FROM `registry_events` WHERE `registry_events`.`status` = 2  ORDER BY `registry_events`.`id` ASC LIMIT 1000
0m
background_1                        |   RegistryEvent Load (0.3ms)  SELECT  `registry_events`.*
portuscontainer                     | GEM_PATH=/srv/Portus/vendor/bundle/ruby/2.5.3
portuscontainer                     | RAILS_ENV=production
portuscontainer                     | RACK_ENV=production
jibl@poste-devops-typique:~/portus.autopilot.provision.XXXXXX/portus/official/compose/examples/compose$ docker-compose logs -f portus|more
Attaching to portuscontainer
portuscontainer                     | + mkdir -p /secrets/certificates
portuscontainer                     | + mkdir -p /secrets/rails
portuscontainer                     | + echo ++++++++++++++++++++++++++
portuscontainer                     | + echo ++++++++++++++++++++++++++
portuscontainer                     | + echo ++++++++++++++++++++++++++
portuscontainer                     | + echo 'PORTUS PKI-INIT'
portuscontainer                     | + echo ++++++++++++++++++++++++++
portuscontainer                     | + echo ++++++++++++++++++++++++++
portuscontainer                     | + echo ++++++++++++++++++++++++++
portuscontainer                     | + set -x
portuscontainer                     | + mkdir -p /certificates
portuscontainer                     | ++++++++++++++++++++++++++
portuscontainer                     | ++++++++++++++++++++++++++
portuscontainer                     | ++++++++++++++++++++++++++
portuscontainer                     | PORTUS PKI-INIT
portuscontainer                     | ++++++++++++++++++++++++++
portuscontainer                     | ++++++++++++++++++++++++++
portuscontainer                     | ++++++++++++++++++++++++++
portuscontainer                     | + cp /secrets/certificates/portus.crt /certificates
portuscontainer                     | + cp /secrets/certificates/portus-oci-registry.crt /certificates
portuscontainer                     | + cp /secrets/certificates/portus-background.crt /certificates
portuscontainer                     | + update-ca-certificates
portuscontainer                     | + set -e
portuscontainer                     | + secrets=(PORTUS_DB_PASSWORD PORTUS_PASSWORD PORTUS_SECRET_KEY_BAS
E PORTUS_EMAIL_SMTP_PASSWORD PORTUS_LDAP_AUTHENTICATION_PASSWORD)
portuscontainer                     | + for s in "${secrets[@]}"
portuscontainer                     | + [[ -z portus ]]
portuscontainer                     | + for s in "${secrets[@]}"
portuscontainer                     | + [[ -z 12341234 ]]
portuscontainer                     | + for s in "${secrets[@]}"
portuscontainer                     | + [[ -z '' ]]
portuscontainer                     | + file_env PORTUS_SECRET_KEY_BASE
portuscontainer                     | + local var=PORTUS_SECRET_KEY_BASE
portuscontainer                     | + local fileVar=PORTUS_SECRET_KEY_BASE_FILE
portuscontainer                     | + local def=
portuscontainer                     | + '[' '' ']'
portuscontainer                     | + local val=
portuscontainer                     | + '[' '' ']'
portuscontainer                     | + '[' /secrets/rails/portus.secret.key.base ']'
portuscontainer                     | + val=dc997f32935707adb399dfe06a57041ce12a8dc96c00898feb016a742da46
d881991f404443c20f559c6cb993cadd6ab68c5c61f88cdc26399adcee6d302d75b
portuscontainer                     | + export PORTUS_SECRET_KEY_BASE=dc997f32935707adb399dfe06a57041ce12
a8dc96c00898feb016a742da46d881991f404443c20f559c6cb993cadd6ab68c5c61f88cdc26399adcee6d302d75b
portuscontainer                     | + PORTUS_SECRET_KEY_BASE=dc997f32935707adb399dfe06a57041ce12a8dc96c
00898feb016a742da46d881991f404443c20f559c6cb993cadd6ab68c5c61f88cdc26399adcee6d302d75b
portuscontainer                     | + unset PORTUS_SECRET_KEY_BASE_FILE
portuscontainer                     | + for s in "${secrets[@]}"
portuscontainer                     | + [[ -z '' ]]
portuscontainer                     | + file_env PORTUS_EMAIL_SMTP_PASSWORD
portuscontainer                     | + local var=PORTUS_EMAIL_SMTP_PASSWORD
portuscontainer                     | + local fileVar=PORTUS_EMAIL_SMTP_PASSWORD_FILE
portuscontainer                     | + local def=
portuscontainer                     | + '[' '' ']'
portuscontainer                     | + local val=
portuscontainer                     | + '[' '' ']'
portuscontainer                     | + '[' '' ']'
portuscontainer                     | + export PORTUS_EMAIL_SMTP_PASSWORD=
portuscontainer                     | + PORTUS_EMAIL_SMTP_PASSWORD=
portuscontainer                     | + unset PORTUS_EMAIL_SMTP_PASSWORD_FILE
portuscontainer                     | + for s in "${secrets[@]}"
portuscontainer                     | + [[ -z '' ]]
portuscontainer                     | + file_env PORTUS_LDAP_AUTHENTICATION_PASSWORD
portuscontainer                     | + local var=PORTUS_LDAP_AUTHENTICATION_PASSWORD
portuscontainer                     | + local fileVar=PORTUS_LDAP_AUTHENTICATION_PASSWORD_FILE
portuscontainer                     | + local def=
portuscontainer                     | + '[' '' ']'
portuscontainer                     | + local val=
portuscontainer                     | + '[' '' ']'
portuscontainer                     | + '[' '' ']'
portuscontainer                     | + export PORTUS_LDAP_AUTHENTICATION_PASSWORD=
portuscontainer                     | + PORTUS_LDAP_AUTHENTICATION_PASSWORD=
portuscontainer                     | + unset PORTUS_LDAP_AUTHENTICATION_PASSWORD_FILE
portuscontainer                     | + update-ca-certificates
portuscontainer                     | + export PORTUS_PUMA_HOST=0.0.0.0:3000
portuscontainer                     | + PORTUS_PUMA_HOST=0.0.0.0:3000
portuscontainer                     | + export RACK_ENV=production
portuscontainer                     | + RACK_ENV=production
portuscontainer                     | + export RAILS_ENV=production
portuscontainer                     | + RAILS_ENV=production
portuscontainer                     | + export CCONFIG_PREFIX=PORTUS
portuscontainer                     | + CCONFIG_PREFIX=PORTUS
portuscontainer                     | + '[' -z '' ']'
portuscontainer                     | + export GEM_PATH=/srv/Portus/vendor/bundle/ruby/2.5.3
portuscontainer                     | + GEM_PATH=/srv/Portus/vendor/bundle/ruby/2.5.3
portuscontainer                     | + '[' debug == debug ']'
portuscontainer                     | + printenv
portuscontainer                     | PORTUS_DB_PASSWORD=portus
portuscontainer                     | PORTUS_DB_HOST=db
portuscontainer                     | HOSTNAME=30b6885e771c
portuscontainer                     | PORTUS_SECURITY_CLAIR_SERVER=http://clair.pegasusio.io:6060
portuscontainer                     | RAILS_SERVE_STATIC_ASSETS='true'
portuscontainer                     | PORTUS_DB_POOL=5
portuscontainer                     | CCONFIG_PREFIX=PORTUS
portuscontainer                     | PORTUS_KEY_PATH=/secrets/certificates/portus.key
portuscontainer                     | PORTUS_LDAP_AUTHENTICATION_PASSWORD=
portuscontainer                     | PWD=/
portuscontainer                     | PORTUS_PUMA_HOST=0.0.0.0:3000
portuscontainer                     | HOME=/root
portuscontainer                     | PORTUS_MACHINE_FQDN_VALUE=portus.pegasusio.io
portuscontainer                     | RAILS_SERVE_STATIC_FILES='true'
portuscontainer                     | + cd /srv/Portus
portuscontainer                     | PORTUS_EMAIL_SMTP_PASSWORD=
portuscontainer                     | GEM_PATH=/srv/Portus/vendor/bundle/ruby/2.5.3
portuscontainer                     | PORTUS_SECURITY_CLAIR_HEALTH_PORT=6061
portuscontainer                     | RAILS_ENV=production
portuscontainer                     | PORTUS_PASSWORD=12341234
portuscontainer                     | PORTUS_SECRET_KEY_BASE=dc997f32935707adb399dfe06a57041ce12a8dc96c00
898feb016a742da46d881991f404443c20f559c6cb993cadd6ab68c5c61f88cdc26399adcee6d302d75b
portuscontainer                     | RACK_ENV=production
portuscontainer                     | PORTUS_SERVICE_FQDN_VALUE=portus.pegasusio.io
portuscontainer                     | PORTUS_LOG_LEVEL=debug
portuscontainer                     | PORTUS_PUMA_TLS_CERT=/secrets/certificates/portus.crt
portuscontainer                     | PORTUS_SECURITY_CLAIR_TIMEOUT=900s
portuscontainer                     | SHLVL=2
portuscontainer                     | PORTUS_PUMA_TLS_KEY=/secrets/certificates/portus.key
portuscontainer                     | PORTUS_DB_DATABASE=portus_production
portuscontainer                     | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
portuscontainer                     | _=/usr/bin/printenv
portuscontainer                     | + '[' '!' -z '' ']'
portuscontainer                     | + '[' -z '' ']'
portuscontainer                     | + setup_database
portuscontainer                     | + wait_for_database 1
portuscontainer                     | + should_setup=1
portuscontainer                     | + TIMEOUT=90
portuscontainer                     | + COUNT=0
portuscontainer                     | + RETRY=1
portuscontainer                     | + '[' 1 -ne 0 ']'
portuscontainer                     | + case $(portusctl exec rails r /srv/Portus/bin/check_db.rb | grep 
DB) in
portuscontainer                     | ++ portusctl exec rails r /srv/Portus/bin/check_db.rb
portuscontainer                     | ++ grep DB
portuscontainer                     | + echo 'Database ready'
portuscontainer                     | + break
portuscontainer                     | + set -e
portuscontainer                     | + portusctl exec 'pumactl -F /srv/Portus/config/puma.rb start'
portuscontainer                     | Database ready
portuscontainer                     | [64] Puma starting in cluster mode...
portuscontainer                     | [64] * Version 3.10.0 (ruby 2.5.0-p0), codename: Russell's Teapot
portuscontainer                     | [64] * Min threads: 1, max threads: 4
portuscontainer                     | [64] * Environment: production
portuscontainer                     | [64] * Process workers: 4
portuscontainer                     | [64] * Preloading application
portuscontainer                     | [Mailer config] Host:     portus.pegasusio.io
portuscontainer                     | [Mailer config] Protocol: https://
portuscontainer                     |   User Exists (0.3ms)  SELECT  1 AS one FROM `users` W
HERE `users`.`username` = 'portus' LIMIT 1
portuscontainer                     |   User Load (0.7ms)  SELECT  `users`.* FROM `users` WHERE
 `users`.`username` = 'portus' LIMIT 1
portuscontainer                     |    (0.4ms)  BEGIN 

Yet worth mentioning

Just to ask in case u know about it : OpenSUSE Leap, it's just like their CentOS Atomic , isn't it ?

even if we get KEEP_LATEST feature

I have to warn you, and the warning stands for both KEEP_LATEST and SYNC :

(like so waiting for your results on keep_latest now :) )

I am not, I 'm addressing an issue identified.

Bug reports:

Please replace this line with a brief summary of your issue AND if reporting a build issue include the link from:

Misc comments / questions

Also, you may add here some more comments and or questions here

Features:

Please note by far the quickest way to get a new feature is to file a Pull Request.

We will consider your request but it may be closed if it's something we're not actively planning to work on.

TODO list

portuscontainer                     | + export RACK_ENV=production
portuscontainer                     | + RACK_ENV=production
portuscontainer                     | + export RAILS_ENV=production
portuscontainer                     | + RAILS_ENV=production
portuscontainer                     | + export CCONFIG_PREFIX=PORTUS
portuscontainer                     | + CCONFIG_PREFIX=PORTUS
portuscontainer                     | + '[' -z '' ']'
portuscontainer                     | + export GEM_PATH=/srv/Portus/vendor/bundle/ruby/2.5.3
portuscontainer                     | + GEM_PATH=/srv/Portus/vendor/bundle/ruby/2.5.3
Jean-Baptiste-Lasselle commented 4 years ago

Funny thing

Check out the commit (and its commit message) of @mssola on https://github.com/opensuse/docker-containers , which is today (1st of March 2020) :

In order to keep Virtualization:containers:Portus cleaner, we have removed some packages from there and we are fetching them now from devel:languages:ruby. I've changed the code so the GPG key for this repo is handled as well.

Moreover, this commit also contains some needed changes on the init file as for the migration to ruby 2.6. Signed-off-by: default avatarMiquel Sabaté Solà msabate@suse.com

:) Note also the commit dates back to 10 months ago :

Jean-Baptiste-Lasselle commented 4 years ago

Other useful info : They use SaltStack, at OpenSUSE

Jean-Baptiste-Lasselle commented 4 years ago

The Real Build from source : Additional info related to /init script fix

Pipeline cycle identified

Ok, the OpenSUSE Team use the https://github.com/SUSE/Portus source code repo, to version control pipeline recipe, and :

I think I've got their cycle there.

Jean-Baptiste-Lasselle commented 4 years ago

Good to know: What is OpenSUSE Leap

SUSE will support migration from Leap to SLE, which gives system integrators developing on Leap the possibility of moving to an enterprise version for certifications, mass deployments and/or extended Long Term Support. openSUSE Leap 15 brings plenty of community packages built on top of a core from SUSE Linux Enterprise (SLE) 15 sources, which is the first time the two major releases were built from the beginning in parallel. Leap 15 shares a common core with SLE 15, which is due for release in the coming months. The first release of Leap was version 42.1, and it was based on the first Service Pack (SP1) of SLE 12. Three years later SUSE’s enterprise version and openSUSE’s community version are now aligned at 15 with a fresh rebase.

Jean-Baptiste-Lasselle commented 4 years ago

Dig in

Exact log of the error analyzed here :

background_1                        | /usr/bin/bundle:23:in `load': cannot load such file -- /usr/lib64/r
uby/gems/2.6.0/gems/bundler-1.16.4/exe/bundle (LoadError)

Paths to check in the execution env. :

jibl@poste-devops-typique:~$ docker exec -it portuscontainer bash -c "ls -allh /usr/lib64/ruby/gems/2.6.0/gems/bundler-1.16.4/exe/bundle"
ls: cannot access '/usr/lib64/ruby/gems/2.6.0/gems/bundler-1.16.4/exe/bundle': No such file or directory
jibl@poste-devops-typique:~$ docker exec -it portuscontainer bash -c "ls -allh /usr/lib64/ruby/gems/2.6.0/gems/bundler-1.16.4/exe"
ls: cannot access '/usr/lib64/ruby/gems/2.6.0/gems/bundler-1.16.4/exe': No such file or directory
jibl@poste-devops-typique:~$ docker exec -it portuscontainer bash -c "ls -allh /usr/lib64/ruby/gems/2.6.0/gems/bundler-1.16.4"
ls: cannot access '/usr/lib64/ruby/gems/2.6.0/gems/bundler-1.16.4': No such file or directory
jibl@poste-devops-typique:~$ docker exec -it portuscontainer bash -c "ls -allh /usr/lib64/ruby/gems/2.6.0/gems"total 52K
drwxr-xr-x 13 root root 4.0K Mar  2 00:52 .
drwxr-xr-x  8 root root 4.0K Mar  2 00:52 ..
drwxr-xr-x  3 root root 4.0K Mar  2 00:52 bundler-1.17.2
drwxr-xr-x  6 root root 4.0K Mar  2 00:52 did_you_mean-1.3.0
drwxr-xr-x  5 root root 4.0K Mar  2 00:52 gem2rpm-0.10.1
drwxr-xr-x  3 root root 4.0K Mar  2 00:52 irb-1.0.0
drwxr-xr-x  3 root root 4.0K Mar  2 00:52 minitest-5.11.3
drwxr-xr-x  4 root root 4.0K Mar  2 00:52 net-telnet-0.2.0
drwxr-xr-x  4 root root 4.0K Mar  2 00:52 power_assert-1.1.3
drwxr-xr-x  6 root root 4.0K Mar  2 00:52 rake-12.3.2
drwxr-xr-x  3 root root 4.0K Mar  2 00:52 rdoc-6.1.2
drwxr-xr-x  5 root root 4.0K Mar  2 00:52 test-unit-3.2.9
drwxr-xr-x  4 root root 4.0K Mar  2 00:52 xmlrpc-0.3.0
jibl@poste-devops-typique:~$ 

Similar issues other projects

Google search :

ruby bundle environment /usr/bin/bundle:23:in `load': cannot load such file -- /usr/lib64/ruby/gems

jibl@poste-devops-typique:~$ docker exec -it compose_background_1 bash -c "cd /srv/Portus && pwd && /usr/bin/gem.ruby2.6 --version"
/srv/Portus
3.0.3
jibl@poste-devops-typique:~$ 

# # remove all old versions of the gem
# gem cleanup rjb

# # choose which ones you want to remove
# gem uninstall rjb

# # remove version 1.1.9 only
# gem uninstall rjb --version 1.1.9

# # remove all versions less than 1.3.4
# gem uninstall rjb --version '<1.3.4'

# https://github.com/rubygems/bundler/releases/tag/v1.17.3
# to remove installed version [1.17.2]
gem uninstall bundle --version '<1.17.3'

# https://github.com/rubygems/bundler/releases/tag/v1.17.3
# to install version [1.16.4]
gem install --version '1.16.4'
mkdir -p /usr/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/exe/
ln -s /var/lib/gems/2.4.0/gems/bundler-1.16.1/exe/bundle /usr/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/exe/

mkdir -p /usr/lib64/ruby/gems/${RUBY_VERSION}/gems/bundler-${BUNDLER_VERSION}/exe/

because on opensuse Leap_15.1 , the

ruby bundle executable is at [/usr/bin/bundle.ruby2.6], not at

[/var/lib/gems/${RUBY_VERSION}/gems ...]

ln -s /usr/bin/bundle.ruby${RUBY_VERSION} /usr/lib64/ruby/gems/${RUBY_VERSION}/gems/bundler-${BUNDLER_VERSION}/exe/

## Versions of `ruby`, `gem`, `bundle`, `bundler`, and `rake` in `opensuzie/portus:2.5`

| executable              | version          | path on openSUSE Leap Distrib.     |
|------------------------ |----------------- |----------------------------------- |
| `ruby`                    | `ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux-gnu]`          | `/usr/bin/ruby.ruby2.6`         |
| `gem`                    | `3.0.3`           | `/usr/bin/gem.ruby2.6`             |
| `bundle`                | `1.17.2`         | `/usr/bin/bundle.ruby2.6`          |
| `bundler`               | `1.17.2`         | `/usr/bin/bundler.ruby2.6`         |
| `rake`                    | `12.3.2`         | `/usr/bin/rake.ruby2.6`            |
| `rails`                    | `5.2.3`           | `/srv/Portus/bin/rails`            |

<pre>
jibl@poste-devops-typique:~$ docker exec -it compose_background_1 bash -c "cd /srv/Portus && pwd && /usr/bin/gem.ruby2.6 --version"
/srv/Portus
3.0.3
jibl@poste-devops-typique:~$ docker exec -it compose_background_1 bash -c "cd /srv/Portus && pwd && /usr/bin/ruby.ruby2.6 --version"
/srv/Portus
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux-gnu]
jibl@poste-devops-typique:~$ docker exec -it compose_background_1 bash -c "cd /srv/Portus && pwd && /usr/bin/bundle.ruby2.6 --version"
/srv/Portus
Bundler version 1.17.2
jibl@poste-devops-typique:~$ docker exec -it compose_background_1 bash -c "cd /srv/Portus && pwd && /usr/bin/bundler.ruby2.6 --version"
/srv/Portus
Bundler version 1.17.2
jibl@poste-devops-typique:~$ docker exec -it compose_background_1 bash -c "cd /srv/Portus && pwd && /usr/bin/rake.ruby2.6 --version"
/srv/Portus
rake, version 12.3.2
jibl@poste-devops-typique:~$ docker exec -it compose_background_1 bash -c "cd /srv/Portus && pwd && /usr/bin/rails.ruby2.6 --version"
/srv/Portus
bash: /usr/bin/rails.ruby2.6: No such file or directory
jibl@poste-devops-typique:~$ docker exec -it compose_background_1 bash -c "cd /srv/Portus && pwd && rails --version"
/srv/Portus
bash: rails: command not found
jibl@poste-devops-typique:~$ 
</pre>

## OpenSUSE how to install ruby

* https://en.opensuse.org/User:Tsu2/Install_Ruby

```bash
#!/bin/bash
# 
# -- 
# -- https://en.opensuse.org/User:Tsu2/Install_Ruby
# -- 
# Add the special openSUSE Ruby repository
zypper ar http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/openSUSE_Leap_15.0/ devel:languages:ruby:extensions && zypper ref

# Execute the command installing your basic tools
# outdated # zypper in ruby rubygem-bundler nodejs git    gcc make libopenssl-devel sqlite3-devel

# --- 
#  Update July 2018: Ruby packages have changed slightly for openSUSE LEAP 15. Other 
# openSUSE versions may similarly need to be modified. Note also that system installed 
# bundle/bundler is now managed by update-alternatives although if the official Ruby repository is 
# onfigured, the bundle/bundler from there could be used. The bottom line for installing is to have 
# a working version installed. 
# --- 
# Me - "The bottom line for installing is to have a working version installed." .... Really ? :/ 
# ---
# 
zypper in ruby ruby2.5-rubygem-bundler nodejs8 git    gcc libopenssl-devel sqlite3-devel

# --- 
# Install Ruby from the openSUSE repos
# ---
# Me - 
# I have the following OpenSUSE Ruby repo inside Dockerfile : 
# 
# ---

zypper in ruby2.5 ruby2.5-devel rubygem-rubygems-update

# zypper refresh # ?

# --
# The full path is described below only for information but is not
# required because the binaries should already be in the system PATH. 
# for Ruby 2.0 export RUBY_GLOBAL_PATH=/usr/bin/ruby2.0   should be in system PATH
# for Ruby version '2.$RUBY_MINOR_VERSION.y',  'x >=1'  export RUBY_GLOBAL_PATH=/usr/bin/ruby.ruby2.$RUBY_MINOR_VERSION
# example    export RUBY_GLOBAL_PATH=/usr/bin/ruby.ruby2.1

zypper cheatsheet

https://en.opensuse.org/images/1/17/Zypper-cheat-sheet-1.pdf

# list all configured repositories
zypper lr

misc test on

opensuzie/protus:2.5

jibl@poste-devops-typique:~$ docker exec -it portuscontainer bash -c "zypper lr"
Repository priorities in effect:                                                (See 'zypper lr -P' for details)
       1 (raised priority)  :  1 repository  
      99 (default priority) :  5 repositories

#  | Alias                     | Name                               | Enabled | GPG Check | Refresh
---+---------------------------+------------------------------------+---------+-----------+--------
 1 | portus                    | portus                             | Yes     | ( p) Yes  | Yes    
 2 | repo-debug                | Debug Repository                   | No      | ----      | ----   
 3 | repo-debug-non-oss        | Debug Repository (Non-OSS)         | No      | ----      | ----   
 4 | repo-debug-update         | Update Repository (Debug)          | No      | ----      | ----   
 5 | repo-debug-update-non-oss | Update Repository (Debug, Non-OSS) | No      | ----      | ----   
 6 | repo-non-oss              | Non-OSS Repository                 | Yes     | ( p) Yes  | No     
 7 | repo-oss                  | Main Repository                    | Yes     | ( p) Yes  | No     
 8 | repo-source               | Source Repository                  | No      | ----      | ----   
 9 | repo-source-non-oss       | Source Repository (Non-OSS)        | No      | ----      | ----   
10 | repo-update               | Main Update Repository             | Yes     | ( p) Yes  | No     
11 | repo-update-non-oss       | Update Repository (Non-Oss)        | Yes     | ( p) Yes  | No     
12 | ruby                      | ruby                               | Yes     | ( p) Yes  | Yes    
jibl@poste-devops-typique:~$ 
# --
jibl@poste-devops-typique:~$ docker exec -it portuscontainer bash -c "ls -allh /usr/bin/ruby.ruby2.*"
-rwxr-xr-x 1 root root 6.3K Jan 14 09:53 /usr/bin/ruby.ruby2.6
jibl@poste-devops-typique:~$ 
jibl@poste-devops-typique:~$ docker exec -it portuscontainer bash -c "ls -allh /usr/bin/gem.*"
-rwxr-xr-x 1 root root 550 Jan 14 09:53 /usr/bin/gem.ruby2.6
jibl@poste-devops-typique:~$ docker exec -it portuscontainer bash -c "/usr/bin/gem.ruby2.6 env"
RubyGems Environment:
  - RUBYGEMS VERSION: 3.0.3
  - RUBY VERSION: 2.6.5 (2019-10-01 patchlevel 114) [x86_64-linux-gnu]
  - INSTALLATION DIRECTORY: /usr/lib64/ruby/gems/2.6.0
  - USER INSTALLATION DIRECTORY: /root/.gem/ruby/2.6.0
  - RUBY EXECUTABLE: /usr/bin/ruby.ruby2.6
  - GIT EXECUTABLE: 
  - EXECUTABLE DIRECTORY: /usr/bin
  - SPEC CACHE DIRECTORY: /root/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/lib64/ruby/gems/2.6.0
     - /root/.gem/ruby/2.6.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => true
     - :bulk_threshold => 1000
     - :benchmark => false
     - :install => "--format-executable --no-user-install"
     - "install" => "--format-executable --no-user-install"
     - :format_executable => true
     - :update => "--format-executable --no-user-install"
     - "update" => "--format-executable --no-user-install"
     - :sources => ["https://rubygems.org"]
  - REMOTE SOURCES:
     - https://rubygems.org
  - SHELL PATH:
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin
jibl@poste-devops-typique:~$ 
jibl@poste-devops-typique:~$ docker exec -it portuscontainer bash -c "ls -allh /usr/bin/|grep bundle"
lrwxrwxrwx 1 root root      24 Jan 14 09:53 bundle -> /etc/alternatives/bundle
-rwxr-xr-x 1 root root     534 Jan 14 09:53 bundle.ruby.ruby2.6
lrwxrwxrwx 1 root root      32 Jan 14 09:53 bundle.ruby2.6 -> /etc/alternatives/bundle.ruby2.6
lrwxrwxrwx 1 root root      25 Jan 14 09:53 bundler -> /etc/alternatives/bundler
-rwxr-xr-x 1 root root     536 Jan 14 09:53 bundler.ruby.ruby2.6
lrwxrwxrwx 1 root root      33 Jan 14 09:53 bundler.ruby2.6 -> /etc/alternatives/bundler.ruby2.6
jibl@poste-devops-typique:~$ 

There you go, now I can compare all that to logged env and error paths.

docker exec -it portuscontainer bash -c "/usr/bin/gem.ruby2.6 update --system"
jibl@poste-devops-typique:~$ docker exec -it portuscontainer bash -c "/usr/bin/gem.ruby2.6 update --system"
Updating rubygems-update
Fetching rubygems-update-3.1.2.gem
Successfully installed rubygems-update-3.1.2
Parsing documentation for rubygems-update-3.1.2
Installing ri documentation for rubygems-update-3.1.2
Installing darkfish documentation for rubygems-update-3.1.2
Done installing documentation for rubygems-update after 73 seconds
Parsing documentation for rubygems-update-3.1.2
Done installing documentation for rubygems-update after 0 seconds
Installing RubyGems 3.1.2
  Successfully built RubyGem
  Name: bundler
  Version: 2.1.2
  File: bundler-2.1.2.gem
Bundler 2.1.2 installed
RubyGems 3.1.2 installed
Regenerating binstubs
Parsing documentation for rubygems-3.1.2
Installing ri documentation for rubygems-3.1.2

=== 3.1.2 / 2019-12-20

Minor enhancements:

* Restore non prompting `gem update --system` behavior. Pull request #3040
  by David Rodríguez.
* Show only release notes for new code installed. Pull request #3041 by
  David Rodríguez.
* Inform about installed `bundle` executable after `gem update --system`.
  Pull request #3042 by David Rodríguez.
* Use Bundler 2.1.2. Pull request #3043 by SHIBATA Hiroshi.

Bug fixes:

* Require `uri` in source.rb. Pull request #3034 by mihaibuzgau.
* Fix `gem update --system --force`. Pull request #3035 by David
  Rodríguez.
* Move `require uri` to source_list. Pull request #3038 by mihaibuzgau.

=== 3.1.1 / 2019-12-16

Bug fixes:

* Vendor Bundler 2.1.0 again. The version of Bundler with
  RubyGems 3.1.0 was Bundler 2.1.0.pre.3. Pull request #3029 by
  SHIBATA Hiroshi.

=== 3.1.0 / 2019-12-16

Major enhancements:

* Vendor bundler 2.1. Pull request #3028 by David Rodríguez.

Minor enhancements:

* Check for rubygems.org typo squatting sources. Pull request #2999 by
  Luis Sagastume.
* Refactor remote fetcher. Pull request #3017 by David Rodríguez.
* Lazily load `open3`. Pull request #3001 by David Rodríguez.
* Remove `delegate` dependency. Pull request #3002 by David Rodríguez.
* Lazily load `uri`. Pull request #3005 by David Rodríguez.
* Lazily load `rubygems/gem_runner` during tests. Pull request #3009 by
  David Rodríguez.
* Use bundler to manage development dependencies. Pull request #3012 by
  David Rodríguez.

Bug fixes:

* Remove unnecessary executable flags. Pull request #2982 by David
  Rodríguez.
* Remove configuration that contained a typo. Pull request #2989 by David
  Rodríguez.

Compatibility changes:

* Remove 1.8.7 leftovers. Pull request #2972 by David Rodríguez.
* Deprecate `gem generate_index --modern` and `gem generate_index
  --no-modern`. Pull request #2992 by David Rodríguez.

=== 3.1.0.pre3 / 2019-11-11

Minor enhancements:

* Fix gem pristine not accounting for user installed gems. Pull request
  #2914 by Luis Sagastume.
* Refactor keyword argument test for Ruby 2.7. Pull request #2947 by
  SHIBATA Hiroshi.
* Fix errors at frozen Gem::Version. Pull request #2949 by Nobuyoshi
  Nakada.
* Remove taint usage on Ruby 2.7+. Pull request #2951 by Jeremy Evans.
* Check Manifest.txt is up to date. Pull request #2953 by David Rodríguez.
* Clarify symlink conditionals in tests. Pull request #2962 by David
  Rodríguez.
* Update command line parsing to work under ps. Pull request #2966 by
  David Rodríguez.
* Properly test `Gem::Specifications.stub_for`. Pull request #2970 by
  David Rodríguez.
* Fix Gem::LOADED_SPECS_MUTEX handling for recursive locking. Pull request
  #2985 by MSP-Greg.

=== 3.1.0.pre2 / 2019-10-15

Minor enhancements:

* Optimize Gem::Package::TarReader#each. Pull request #2941 by Jean byroot
  Boussier.
* Time comparison around date boundary. Pull request #2944 by Nobuyoshi
  Nakada.

=== 3.1.0.pre1 / 2019-10-08

Major enhancements:

* Try to use bundler-2.1.0.pre.2. Pull request #2923 by SHIBATA Hiroshi.
* [Require] Ensure -I beats a default gem. Pull request #1868 by Samuel
  Giddins.
* [Specification] Prefer user-installed gems to default gems. Pull request
  #2112 by Samuel Giddins.
* Multifactor authentication for yank command. Pull request #2514 by Qiu
  Chaofan.
* Autoswitch to exact bundler version if present. Pull request #2583 by
  David Rodríguez.

Minor enhancements:

* Fix Gem::Requirement equality comparison when ~> operator is used. Pull
  request #2554 by Grey Baker.
* Don't use a proxy if https_proxy env var is empty. Pull request #2567 by
  Luis Sagastume.
* Fix typo in specs warning. Pull request #2585 by Rui.
* Bin/gem: remove initial empty line. Pull request #2602 by Kenyon Ralph.
* Avoid rdoc hook when it's failed to load rdoc library. Pull request
  #2604 by SHIBATA Hiroshi.
* Refactor get_proxy_from_env logic. Pull request #2611 by Luis Sagastume.
* Allow to easily bisect flaky failures. Pull request #2626 by David
  Rodríguez.
* Fix `--ignore-dependencies` flag not installing platform specific gems.
  Pull request #2631 by David Rodríguez.
* Make `gem install --explain` list platforms. Pull request #2634 by David
  Rodríguez.
* Make `gem update --explain` list platforms. Pull request #2635 by David
  Rodríguez.
* Refactoring install and update explanations. Pull request #2643 by David
  Rodríguez.
* Restore transitiveness of version comparison. Pull request #2651 by
  David Rodríguez.
* Undo requirement sorting. Pull request #2652 by David Rodríguez.
* Update dummy version of Bundler for #2581. Pull request #2584 by SHIBATA
  Hiroshi.
* Ignore to handle the different platform. Pull request #2672 by SHIBATA
  Hiroshi.
* Make Gem::Specification.default_stubs to public methods. Pull request
  #2675 by SHIBATA Hiroshi.
* Sort files and test_files in specifications. Pull request #2524 by
  Christopher Baines.
* Fix comment of Gem::Specification#required_ruby_version=. Pull request
  #2732 by Alex Junger.
* Config_file.rb - update path separator in ENV['GEMRC'] logic. Pull
  request #2735 by MSP-Greg.
* Fix `ruby setup.rb` warnings. Pull request #2737 by David Rodríguez.
* Don't use regex delimiters when searching for a dependency. Pull request
  #2738 by Luis Sagastume.
* Refactor query command. Pull request #2739 by Luis Sagastume.
* Don't remove default spec files from mapping after require. Pull request
  #2741 by David Rodríguez.
* Cleanup base test case. Pull request #2742 by David Rodríguez.
* Simplify Specification#gems_dir. Pull request #2745 by David Rodríguez.
* Fix test warning. Pull request #2746 by David Rodríguez.
* Extract an `add_to_load_path` method. Pull request #2749 by David
  Rodríguez.
* Fix setup command if format_executable is true by default. Pull request
  #2766 by Jeremy Evans.
* Update the certificate files to make the test pass on Debian 10. Pull
  request #2777 by Yusuke Endoh.
* Write to the correct config file(.gemrc). Pull request #2779 by Luis
  Sagastume.
* Fix for large values in UID/GID fields in tar archives. Pull request
  #2780 by Alexey Shein.
* Lazy require stringio. Pull request #2781 by Luis Sagastume.
* Make Gem::Specification#ruby_code handle OpenSSL::PKey::RSA objects.
  Pull request #2782 by Luis Sagastume.
* Fix setup command test for bundler with program_suffix. Pull request
  #2783 by Sorah Fukumori.
* Make sure `rake package` works. Pull request #2787 by David Rodríguez.
* Synchronize access to the Gem::Specification::LOAD_CACHE Hash. Pull
  request #2789 by Benoit Daloze.
* Task to install rubygems to local system. Pull request #2795 by David
  Rodríguez.
* Add an attr_reader to Gem::Installer for the package instance variable.
  Pull request #2796 by Daniel Berger.
* Switch CI script to bash. Pull request #2799 by David Rodríguez.
* Move gemcutter utilities code to Gem::Command. Pull request #2803 by
  Luis Sagastume.
* Add raw spec method to gem package. Pull request #2806 by Luis
  Sagastume.
* Improve `rake package` test error message. Pull request #2815 by David
  Rodríguez.
* Resolve `@@project_dir` from test file paths. Pull request #2843 by
  Nobuyoshi Nakada.
* Remove dead code in Gem::Validator. Pull request #2537 by Ellen Marie
  Dash.
* The date might have advanced since TODAY has been set. Pull request
  #2938 by Nobuyoshi Nakada.
* Remove old ci configurations. Pull request #2917 by SHIBATA Hiroshi.
* Add Gem::Dependency identity. Pull request #2936 by Luis Sagastume.
* Filter dependency type and name strictly. Pull request #2930 by SHIBATA
  Hiroshi.
* Always pass an encoding option to Zlib::GzipReader.wrap. Pull request
  #2933 by Nobuyoshi Nakada.
* Introduce default prerelease requirement. Pull request #2925 by David
  Rodríguez.
* Detect libc version, closes #2918. Pull request #2922 by fauno.
* Use IAM role to extract security-credentials for EC2 instance. Pull
  request #2894 by Alexander Pakulov.
* Improve `gem uninstall --all`. Pull request #2893 by David Rodríguez.
* Use `RbConfig::CONFIG['rubylibprefix']`. Pull request #2889 by Nobuyoshi
  Nakada.
* Build the first gemspec we found if no arguments are passed to gem
  build. Pull request #2887 by Luis Sagastume.
* $LOAD_PATH elements should be real paths. Pull request #2885 by
  Nobuyoshi Nakada.
* Use the standard RUBY_ENGINE_VERSION instead of JRUBY_VERSION. Pull
  request #2864 by Benoit Daloze.
* Cleanup after testing `rake package`. Pull request #2862 by David
  Rodríguez.
* Cherry-pick shushing deprecation warnings from ruby-core. Pull request
  #2861 by David Rodríguez.
* Ext/builder.rb cleanup. Pull request #2849 by Luis Sagastume.
* Fix @ran_rake assignment in builder.rb. Pull request #2850 by Luis
  Sagastume.
* Remove test suite warnings. Pull request #2845 by Luis Sagastume.
* Replace domain parameter with a parameter to suppress suggestions. Pull
  request #2846 by Luis Sagastume.
* Move default specifications dir definition out of BasicSpecification.
  Pull request #2841 by Vít Ondruch.
* There is no usage of @orig_env_* variables in test suite. Pull request
  #2838 by SHIBATA Hiroshi.
* Use File#open instead of Kernel#open in stub_specification.rb. Pull
  request #2834 by Luis Sagastume.
* Simplify #to_ruby code. Pull request #2825 by Nobuyoshi Nakada.
* Add a gem attr to the Gem::Package class. Pull request #2828 by Daniel
  Berger.
* Remove useless TODO comment. Pull request #2818 by Luis Sagastume.

Bug fixes:

* Fix typos in History.txt. Pull request #2565 by Igor Zubkov.
* Remove unused empty sources array. Pull request #2598 by Aaron
  Patterson.
* Fix windows specific executables generated by `gem install`. Pull
  request #2628 by David Rodríguez.
* Gem::Specification#to_ruby needs OpenSSL. Pull request #2937 by
  Nobuyoshi Nakada.
* Set SOURCE_DATE_EPOCH env var if not provided. Pull request #2882 by
  Ellen Marie Dash.
* Installer.rb - fix #windows_stub_script. Pull request #2876 by MSP-Greg.
* Fixed deprecation message. Pull request #2867 by Nobuyoshi Nakada.
* Fix requiring default gems to consider prereleases. Pull request #2728
  by David Rodríguez.
* Forbid `find_spec_for_exe` without an `exec_name`. Pull request #2706 by
  David Rodríguez.
* Do not prompt for passphrase when key can be loaded without it. Pull
  request #2710 by Luis Sagastume.
* Add missing wrapper. Pull request #2690 by David Rodríguez.
* Remove long ago deprecated methods. Pull request #2704 by David
  Rodríguez.
* Renamed duplicate test. Pull request #2678 by Nobuyoshi Nakada.
* File.exists? is deprecated. Pull request #2855 by SHIBATA Hiroshi.
* Fixed to warn with shadowing outer local variable. Pull request #2856 by
  SHIBATA Hiroshi.
* Fix explain with ignore-dependencies. Pull request #2647 by David
  Rodríguez.
* Fix default gem executable installation when folder is not `bin/`. Pull
  request #2649 by David Rodríguez.
* Fix cryptic error on local and ignore-dependencies combination. Pull
  request #2650 by David Rodríguez.

Compatibility changes:

* Remove commented code from command.rb. Pull request #2620 by Luis
  Sagastume.
* Suppress keywords warning. Pull request #2934 by Nobuyoshi Nakada.
* Suppress Ruby 2.7's real kwargs warning. Pull request #2912 by Koichi
  ITO.
* Fix Kernel#warn override. Pull request #2911 by Jeremy Evans.
* Make deprecate Gem::RubyGemsVersion and Gem::ConfigMap. Pull request
  #2857 by SHIBATA Hiroshi.
* Deprecate Gem::RemoteFetcher#fetch_size. Pull request #2833 by Luis
  Sagastume.
* Remove conflict.rb code that was supposed to be removed in Rubygems 3.
  Pull request #2802 by Luis Sagastume.
* Explicitly deprecate `rubyforge_project`. Pull request #2798 by David
  Rodríguez.
* Compatibility cleanups. Pull request #2754 by David Rodríguez.
* Remove `others_possible` activation request param. Pull request #2747 by
  David Rodríguez.
* Remove dependency installer deprecated code. Pull request #2740 by Luis
  Sagastume.
* Deprecate unused Gem::Installer#unpack method. Pull request #2715 by Vít
  Ondruch.
* Removed guard condition with USE_BUNDLER_FOR_GEMDEPS. Pull request #2716
  by SHIBATA Hiroshi.
* Skip deprecation warning during specs. Pull request #2718 by David
  Rodríguez.
* Remove QuickLoader reference. Pull request #2719 by David Rodríguez.
* Removed circular require. Pull request #2679 by Nobuyoshi Nakada.
* Removed needless environmental variable for Travis CI. Pull request
  #2685 by SHIBATA Hiroshi.
* Deprecate a few unused methods. Pull request #2674 by David Rodríguez.
* Removing yaml require. Pull request #2538 by Luciano Sousa.
* Add deprecation warnings for cli options. Pull request #2607 by Luis
  Sagastume.

Style changes:

* Enable `Layout/SpaceInsideParens` rubocop cop. Pull request #2630 by
  David Rodríguez.
* Remove some extra empty lines from the repo. Pull request #2669 by David
  Rodríguez.
* Enable Style/EmptyLinesAroundClassBody rubocop cop. Pull request #2636
  by David Rodríguez.
* Enable Style/BlockDelimiters rubocop cop. Pull request #2640 by David
  Rodríguez.
* Enable Layout/SpaceAroundOperators rubocop cop. Pull request #2642 by
  David Rodríguez.
* Rubocop 0.71. Pull request #2785 by David Rodríguez.

=== 3.0.6 / 2019-08-17

Bug fixes:

* Revert #2813. It broke the compatibility with 3.0.x versions.

=== 3.0.5 / 2019-08-16

Minor enhancements:

* Use env var to configure api key on push. Pull request #2559 by Luis
  Sagastume.
* Unswallow uninstall error. Pull request #2707 by David Rodríguez.
* Expose windows path normalization utility. Pull request #2767 by David
  Rodríguez.
* Clean which command. Pull request #2801 by Luis Sagastume.
* Upgrading S3 source signature to AWS SigV4. Pull request #2807 by
  Alexander Pakulov.
* Remove missleading comment, no reason to move Gem.host to Gem::Util.
  Pull request #2811 by Luis Sagastume.
* Drop support for 'gem env packageversion'. Pull request #2813 by Luis
  Sagastume.
* Take into account just git tracked files in update_manifest rake task.
  Pull request #2816 by Luis Sagastume.
* Remove TODO comment, there's no Gem::Dirs constant. Pull request #2819
  by Luis Sagastume.
* Remove unused 'raise' from test_case. Pull request #2820 by Luis
  Sagastume.
* Move TODO comment to an information comment. Pull request #2821 by Luis
  Sagastume.
* Use File#open instead of Kernel#open in stub_specification.rb. Pull
  request #2834 by Luis Sagastume.
* Make error code a gemcutter_utilities a constant. Pull request #2844 by
  Luis Sagastume.
* Remove FIXME comment related to PathSupport. Pull request #2854 by Luis
  Sagastume.
* Use gsub with Hash. Pull request #2860 by Kazuhiro NISHIYAMA.
* Use the standard RUBY_ENGINE_VERSION instead of JRUBY_VERSION. Pull
  request #2864 by Benoit Daloze.
* Do not mutate uri.query during s3 signature creation. Pull request #2874
  by Alexander Pakulov.
* Fixup #2844. Pull request #2878 by SHIBATA Hiroshi.

Bug fixes:

* Fix intermittent test error on Appveyor & Travis. Pull request #2568 by
  MSP-Greg.
* Extend timeout on assert_self_install_permissions. Pull request #2605 by
  SHIBATA Hiroshi.
* Better folder assertions. Pull request #2644 by David Rodríguez.
* Fix default gem executable installation when folder is not `bin/`. Pull
  request #2649 by David Rodríguez.
* Fix gem uninstall behavior. Pull request #2663 by Luis Sagastume.
* Fix for large values in UID/GID fields in tar archives. Pull request
  #2780 by Alexey Shein.
* Fixed task order for release. Pull request #2792 by SHIBATA Hiroshi.
* Ignore GEMRC variable for test suite. Pull request #2837 by SHIBATA
  Hiroshi.

=== 3.0.4 / 2019-06-14

Minor enhancements:

* Add support for TruffleRuby #2612 by Benoit Daloze
* Serve a more descriptive error when --no-ri or --no-rdoc are used #2572
  by Grey Baker
* Improve test compatibility with CMake 2.8. Pull request #2590 by Vít
  Ondruch.
* Restore gem build behavior and introduce the "-C" flag to gem build.
  Pull request #2596 by Luis Sagastume.
* Enabled block call with util_set_arch. Pull request #2603 by SHIBATA
  Hiroshi.
* Avoid rdoc hook when it's failed to load rdoc library. Pull request
  #2604 by SHIBATA Hiroshi.
* Drop tests for legacy RDoc. Pull request #2608 by Nobuyoshi Nakada.
* Update TODO comment. Pull request #2658 by Luis Sagastume.
* Skip malicious extension test with mswin platform. Pull request #2670 by
  SHIBATA Hiroshi.
* Check deprecated methods on release. Pull request #2673 by David
  Rodríguez.
* Add steps to run bundler tests. Pull request #2680 by Aditya Prakash.
* Skip temporary "No such host is known" error. Pull request #2684 by
  Takashi Kokubun.
* Replaced aws-sdk-s3 instead of s3cmd. Pull request #2688 by SHIBATA
  Hiroshi.
* Allow uninstall from symlinked GEM_HOME. Pull request #2720 by David
  Rodríguez.
* Use current checkout in CI to uninstall RVM related gems. Pull request
  #2729 by David Rodríguez.
* Update Contributor Covenant v1.4.1. Pull request #2751 by SHIBATA
  Hiroshi.
* Added supported versions of Ruby. Pull request #2756 by SHIBATA Hiroshi.
* Fix shadowing outer local variable warning. Pull request #2763 by Luis
  Sagastume.
* Update the certificate files to make the test pass on Debian 10. Pull
  request #2777 by Yusuke Endoh.
* Backport ruby core changes. Pull request #2778 by SHIBATA Hiroshi.

Bug fixes:

* Test_gem.rb - intermittent failure fix. Pull request #2613 by MSP-Greg.
* Fix sporadic CI failures. Pull request #2617 by David Rodríguez.
* Fix flaky bundler version finder tests. Pull request #2624 by David
  Rodríguez.
* Fix gem indexer tests leaking utility gems. Pull request #2625 by David
  Rodríguez.
* Clean up default spec dir too. Pull request #2639 by David Rodríguez.
* Fix 2.6.1 build against vendored bundler. Pull request #2645 by David
  Rodríguez.
* Fix comment typo. Pull request #2664 by Luis Sagastume.
* Fix comment of Gem::Specification#required_ruby_version=. Pull request
  #2732 by Alex Junger.
* Fix TODOs. Pull request #2748 by David Rodríguez.

------------------------------------------------------------------------------

RubyGems installed the following executables:
    /usr/bin/gem.ruby2.6
    /usr/bin/bundle.ruby2.6

Ruby Interactive (ri) documentation was installed. ri is kind of like man 
pages for Ruby libraries. You may access it like this:
  ri Classname
  ri Classname.class_method
  ri Classname#instance_method
If you do not wish to install this documentation in the future, use the
--no-document flag, or set it as the default in your ~/.gemrc file. See
'gem help env' for details.

RubyGems system software updated
jibl@poste-devops-typique:~$ 
docker exec -it compose_background_1 bash -c "cd /srv/Portus && pwd && ls -allh && /usr/bin/gem.ruby2.6 install bundler:1.17.3 && bundle update --bundler && bundle install --deployment"
vents` WHERE `registry_events`.`status` = 2 ORDER BY `registry_events`.`id` ASC LIMIT 1000
background_1                        |   RegistryEvent Load (0.3ms)  SELECT  `registry_events`.* FROM `registry_events` WHERE `registry_events`.`status` = 2 ORDER BY `registry_events`.`id` ASC LIMIT 1000
background_1                        |   RegistryEvent Load (0.3ms)  SELECT  `registry_events`.* FROM `registry_events` WHERE `registry_events`.`status` = 2 ORDER BY `registry_events`.`id` ASC LIMIT 1000
background_1                        | /srv/Portus/vendor/bundle/ruby/2.6.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:131:in `_query': Mysql2::Error::ConnectionError: Lost connection to MySQL server during query: SELECT  `registry_events`.* FROM `registry_events` WHERE `registry_events`.`status` = 2 ORDER BY `registry_events`.`id` ASC LIMIT 1000 (ActiveRecord::StatementInvalid)
background_1                        |   from /srv/Portus/vendor/bundle/ruby/2.6.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:131:in `block in query'
background_1                        |   from /srv/Portus/vendor/bundle/ruby/2.6.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:130:in `handle_interrupt'
background_1                        |   from /srv/Portus/vendor/bundle/ruby/2.6.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:130:in `query'
Jean-Baptiste-Lasselle commented 4 years ago

About the GEM_PATH envrionment variable

In a fresh unmodified opensuzie/portus:2.5 container :

 
jibl@poste-devops-typique:~$ docker exec -it portuscontainer bash -c "ls -allh /srv/Portus/vendor/bundle/ruby/2.5.3"
ls: cannot access '/srv/Portus/vendor/bundle/ruby/2.5.3': No such file or directory
jibl@poste-devops-typique:~$ docker exec -it portuscontainer bash -c "ls -allh /srv/Portus/vendor/bundle/ruby/2.5.0"
ls: cannot access '/srv/Portus/vendor/bundle/ruby/2.5.0': No such file or directory
jibl@poste-devops-typique:~$ docker exec -it portuscontainer bash -c "ls -allh /srv/Portus/vendor/bundle/ruby/2.6.0"
total 36K
drwxr-xr-x   9 root root 4.0K Mar  2 00:52 .
drwxr-xr-x   3 root root 4.0K Mar  2 00:52 ..
drwxr-xr-x   2 root root 4.0K Mar  2 00:52 bin
drwxr-xr-x   2 root root 4.0K Mar  2 00:52 build_info
drwxr-xr-x   2 root root 4.0K Feb 28 12:47 cache
drwxr-xr-x   2 root root 4.0K Feb 28 12:42 doc
drwxr-xr-x   3 root root 4.0K Mar  2 00:52 extensions
drwxr-xr-x 121 root root 4.0K Mar  2 00:52 gems
drwxr-xr-x   2 root root 4.0K Mar  2 00:52 specifications
jibl@poste-devops-typique:~$ docker exec -it compose_background_1 bash -c "ls -allh /srv/Portus/vendor/bundle/ruby/2.5.3"
ls: cannot access '/srv/Portus/vendor/bundle/ruby/2.5.3': No such file or directory
jibl@poste-devops-typique:~$ docker exec -it compose_background_1 bash -c "ls -allh /srv/Portus/vendor/bundle/ruby/2.5.0"
ls: cannot access '/srv/Portus/vendor/bundle/ruby/2.5.0': No such file or directory
jibl@poste-devops-typique:~$ docker exec -it compose_background_1 bash -c "ls -allh /srv/Portus/vendor/bundle/ruby/2.6.0"
total 36K
drwxr-xr-x   9 root root 4.0K Mar  2 00:52 .
drwxr-xr-x   3 root root 4.0K Mar  2 00:52 ..
drwxr-xr-x   2 root root 4.0K Mar  2 00:52 bin
drwxr-xr-x   2 root root 4.0K Mar  2 00:52 build_info
drwxr-xr-x   2 root root 4.0K Feb 28 12:47 cache
drwxr-xr-x   2 root root 4.0K Feb 28 12:42 doc
drwxr-xr-x   3 root root 4.0K Mar  2 00:52 extensions
drwxr-xr-x 121 root root 4.0K Mar  2 00:52 gems
drwxr-xr-x   2 root root 4.0K Mar  2 00:52 specifications
jibl@poste-devops-typique:~$ 

background_1                        | /usr/bin/bundle:23:in `load': cannot load such file -- /usr/lib64/ruby/gems/2.6.0/gems/bundler-1.16.4/exe/bundle (LoadError)
Jean-Baptiste-Lasselle commented 4 years ago

Resetting version of bundler / bundle

jibl@poste-devops-typique:~$ docker exec -it compose_background_1 bash -c "cd /srv/Portus && pwd && /usr/bin/gem.ruby2.6 uninstall bundle --version '<1.17.3'"
/srv/Portus
Gem 'bundle' is not installed
jibl@poste-devops-typique:~$ docker exec -it compose_background_1 bash -c "cd /srv/Portus && pwd && /usr/bin/gem.ruby2.6 uninstall bundler --version '<1.17.3'"
/srv/Portus
jibl@poste-devops-typique:~$ 
jibl@poste-devops-typique:~$ docker exec -it compose_background_1 bash -c "cd /srv/Portus && pwd && ls -allh && bundle install --deployment"
/srv/Portus
total 392K
drwxr-xr-x  1 root root 4.0K Mar  2 00:52 .
drwxr-xr-x  1 root root 4.0K Mar  2 00:52 ..
drwxr-xr-x  2 root root 4.0K Mar  2 00:52 .bundle
-rw-r--r--  1 root root   41 Feb 28 12:47 .gitcommit
-rw-r--r--  1 root root    6 Sep 19 14:22 .ruby-version
-rw-r--r--  1 root root  56K Sep 19 14:22 CHANGELOG.md
-rw-r--r--  1 root root 5.0K Sep 19 14:22 CONTRIBUTING.md
-rw-r--r--  1 root root 2.2K Sep 19 14:22 Gemfile
-rw-r--r--  1 root root  14K Sep 19 14:22 Gemfile.lock
-rw-r--r--  1 root root 1.1K Sep 19 14:22 Guardfile
-rw-r--r--  1 root root  12K Sep 19 14:22 LICENSE
-rw-r--r--  1 root root 6.1K Sep 19 14:22 README.md
-rw-r--r--  1 root root  388 Sep 19 14:22 Rakefile
-rw-r--r--  1 root root   10 Sep 19 14:22 VERSION
drwxr-xr-x 11 root root 4.0K Mar  2 00:52 app
drwxr-xr-x  4 root root 4.0K Mar  2 00:52 bin
drwxr-xr-x  6 root root 4.0K Mar  2 00:52 config
-rw-r--r--  1 root root  247 Sep 19 14:22 config.ru
drwxr-xr-x  1 root root 4.0K Mar  2 03:05 db
drwxr-xr-x  6 root root 4.0K Mar  2 00:52 lib
drwxr-xr-x  2 root root 4.0K Feb 28 12:48 log
-rw-r--r--  1 root root 2.0K Sep 19 14:22 package.json
drwxr-xr-x  4 root root 4.0K Mar  2 00:52 public
drwxr-xr-x  1 root root 4.0K Mar  2 03:05 tmp
drwxr-xr-x  9 root root 4.0K Mar  2 00:52 vendor
-rw-r--r--  1 root root 210K Sep 19 14:22 yarn.lock
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will
break this application for all non-root users on this machine.
Warning: the running version of Bundler (1.17.2) is older than the version that created the lockfile (1.17.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
Using rake 12.3.2
Using concurrent-ruby 1.1.5
Using i18n 1.6.0
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.2.3
Using builder 3.2.3
Using erubi 1.8.0
Using mini_portile2 2.4.0
Using nokogiri 1.10.2
Using rails-dom-testing 2.0.3
Using crass 1.0.4
Using loofah 2.2.3
Using rails-html-sanitizer 1.0.4
Using actionview 5.2.3
Using rack 2.0.7
Using rack-test 1.1.0
Using actionpack 5.2.3
Using nio4r 2.3.1
Using websocket-extensions 0.1.3
Using websocket-driver 0.7.0
Using actioncable 5.2.3
Using globalid 0.4.2
Using activejob 5.2.3
Using mini_mime 1.0.1
Using mail 2.7.1
Using actionmailer 5.2.3
Using activemodel 5.2.3
Using arel 9.0.0
Using activerecord 5.2.3
Using active_record_union 1.3.0
Using mimemagic 0.3.3
Using marcel 0.3.3
Using activestorage 5.2.3
Using public_suffix 3.0.3
Using addressable 2.6.0
Using aes_key_wrap 1.0.1
Using attr_required 1.0.1
Using descendants_tracker 0.0.4
Using ice_nine 0.11.2
Using axiom-types 0.1.1
Using base32 0.3.2
Using bcrypt 3.1.12
Using bindata 2.4.4
Using bundler 1.17.2
Using safe_yaml 1.0.5
Using cconfig 1.2.1
Using coercible 1.0.0
Using orm_adapter 0.5.0
Using method_source 0.9.2
Using thor 0.20.3
Using railties 5.2.3
Using responders 2.4.1
Using warden 1.2.8
Using devise 4.6.2
Using equalizer 0.0.11
Using ffi 1.9.25
Using ethon 0.12.0
Using multipart-post 2.0.0
Using faraday 0.9.2
Using font-awesome-rails 4.7.0.5
Using mustermann 1.0.3
Using mustermann-grape 1.0.0
Using rack-accept 0.4.5
Using virtus 1.0.5
Using grape 1.2.3
Using multi_json 1.13.1
Using grape-entity 0.7.1
Using grape-swagger 0.32.1
Using grape-swagger-entity 0.3.3
Using gravatar_image_tag 1.2.0
Using hashie 3.6.0
Using hashie-forbidden_attributes 0.1.1
Using httpclient 2.8.3
Using json-jwt 1.10.0
Using jwt 2.1.0
Using kaminari-core 1.1.1
Using kaminari-actionview 1.1.1
Using kaminari-activerecord 1.1.1
Using kaminari 1.1.1
Using multi_xml 0.6.0
Using mysql2 0.5.2
Using net-ldap 0.16.1
Using oauth2 1.4.1
Using omniauth 1.9.0
Using omniauth-oauth2 1.6.0
Using omniauth-github 1.3.0
Using omniauth-gitlab 2.0.0
Using omniauth-google-oauth2 0.6.1
Using ruby-openid 2.7.0
Using rack-openid 1.3.1
Using omniauth-openid 1.0.1
Using rack-oauth2 1.9.3
Using swd 1.1.2
Using validate_email 0.1.6
Using validate_url 1.0.8
Using webfinger 1.1.0
Using openid_connect 1.1.6
Using omniauth_openid_connect 0.2.4
Using pg 1.1.4
Using polyglot 0.3.5
Using public_activity 1.6.3
Using puma 3.12.1
Using pundit 2.0.1
Using rack-cors 1.0.3
Using sprockets 3.7.2
Using sprockets-rails 3.2.1
Using rails 5.2.3
Using redcarpet 3.4.0
Using sassc 2.0.1
Using tilt 2.0.9
Using sassc-rails 2.1.0
Using treetop 1.6.10
Using search_cop 1.0.9
Using temple 0.8.1
Using slim 4.0.1
Using typhoeus 1.3.1
Using webpack-rails 0.9.11
Bundle complete! 80 Gemfile dependencies, 119 gems now installed.
Gems in the groups test, development and assets were not installed.
Bundled gems are installed into `./vendor/bundle`
jibl@poste-devops-typique:~$ 
docker-compose restart && docker-compose logs -f
B) in
portuscontainer                     | ++ portusctl exec rails r /srv/Portus/bin/check_db.rb
portuscontainer                     | ++ grep DB
portuscontainer                     | + '[' 1 -eq 1 ']'
portuscontainer                     | + echo 'Initializing database'
portuscontainer                     | + portusctl exec rake db:setup
portuscontainer                     | Initializing database
portuscontainer                     | Database 'portus_production' already exists
portuscontainer                     | rake aborted!
portuscontainer                     | ActiveRecord::NoEnvironmentInSchemaError: 
portuscontainer                     | 
portuscontainer                     | Environment data not found in the schema. To resolve this issue, ru
n: 
portuscontainer                     | 
portuscontainer                     |         bin/rails db:environment:set RAILS_ENV=production
portuscontainer                     | 
portuscontainer                     | /srv/Portus/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/ac
tive_record/migration.rb:1132:in `last_stored_environment'
portuscontainer                     | /srv/Portus/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/ac
tive_record/tasks/database_tasks.rb:58:in `check_protected_environments!'
portuscontainer                     | /srv/Portus/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/ac
tive_record/railties/databases.rake:13:in `block (2 levels) in '
portuscontainer                     | /srv/Portus/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/ac
tive_record/railties/databases.rake:262:in `block (3 levels) in '
portuscontainer                     | /srv/Portus/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/exe/rake:27:i

Jean-Baptiste-Lasselle commented 4 years ago

RAILS_ENV=production for portus database

jibl@poste-devops-typique:~$ docker exec -it portuscontainer bash -c "cd /srv/Portus && pwd && export RAILS_ENV=production && ./bin/rails db:environment:set RAILS_ENV=production"
/srv/Portus
[schema] Selected the schema for mysql
   (0.3ms)  SET NAMES utf8,  @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'),  @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
rails aborted!
Environment variable `PORTUS_SECRET_KEY_BASE` has not been set! This variable is mandatory in production because it's needed for the generation of secrets.
/srv/Portus/config/initializers/environment_check.rb:14:in `mandatory_secret!'
/srv/Portus/config/initializers/environment_check.rb:36:in `'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `load'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `block in load'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `load'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:657:in `block in load_config_initializer'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/notifications.rb:170:in `instrument'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:656:in `load_config_initializer'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:614:in `block (2 levels) in '
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:613:in `each'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:613:in `block in '
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `instance_exec'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `run'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:61:in `block in run_initializers'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:50:in `each'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:50:in `tsort_each_child'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:60:in `run_initializers'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/application.rb:361:in `initialize!'
/srv/Portus/config/environment.rb:7:in `'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/application.rb:337:in `require_environment!'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command.rb:48:in `invoke'
/srv/Portus/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `'
./bin/rails:12:in `require'
./bin/rails:12:in `
' Tasks: TOP => db:environment:set => db:load_config => environment (See full trace by running task with --trace) jibl@poste-devops-typique:~$
docker-compose down && docker system prune -f --volumes && docker-compose up -d --force-recreate && docker-compose logs -f
docker exec -it portuscontainer bash -c "cd /srv/Portus && pwd && export RAILS_ENV=production && /usr/bin/gem.ruby2.6 uninstall bundler --version '<1.17.3'"
docker exec -it portuscontainer bash -c "cd /srv/Portus && pwd && export RAILS_ENV=production && /usr/bin/gem.ruby2.6 install bundler --version '1.16.4'"
docker exec -it portuscontainer bash -c "cd /srv/Portus && pwd && ls -allh && export RAILS_ENV_production && bundle install --deployment"

# and instead of : 
# docker exec -it portuscontainer bash -c "cd /srv/Portus && pwd && export RAILS_ENV=production && ./bin/rails db:environment:set RAILS_ENV=production"

# I run : 
docker exec -it portuscontainer bash -c "cd /srv/Portus && pwd && export RAILS_ENV=production && export PORTUS_SECRET_KEY_BASE=\$(cat /secrets/rails/portus.secret.key.base) && ./bin/rails db:environment:set RAILS_ENV=production"

portuscontainer                     | GEM_PATH=/srv/Portus/vendor/bundle/ruby/2.5.3
portuscontainer                     | PORTUS_SECURITY_CLAIR_HEALTH_PORT=6061
portuscontainer                     | RAILS_ENV=production
portuscontainer                     | PORTUS_PASSWORD=12341234
portuscontainer                     | PORTUS_SECRET_KEY_BASE=a0bbba25c7cfd2e1266907e80575685d0782e86eda3a1aff43b61f0554efe4a973be62658e44b9aa2a158833267138eb7d3373a1e060c7c0737bf2100493b41f
portuscontainer                     | RACK_ENV=production
portuscontainer                     | PORTUS_SERVICE_FQDN_VALUE=portus.pegasusio.io
portuscontainer                     | PORTUS_LOG_LEVEL=debug
portuscontainer                     | PORTUS_PUMA_TLS_CERT=/secrets/certificates/portus.crt
portuscontainer                     | PORTUS_SECURITY_CLAIR_TIMEOUT=900s
portuscontainer                     | SHLVL=2
portuscontainer                     | PORTUS_PUMA_TLS_KEY=/secrets/certificates/portus.key
portuscontainer                     | PORTUS_DB_DATABASE=portus_production
portuscontainer                     | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
portuscontainer                     | _=/usr/bin/printenv
portuscontainer                     | + cd /srv/Portus
portuscontainer                     | + '[' '!' -z '' ']'
portuscontainer                     | + '[' -z '' ']'
portuscontainer                     | + setup_database
portuscontainer                     | + wait_for_database 1
portuscontainer                     | + should_setup=1
portuscontainer                     | + TIMEOUT=90
portuscontainer                     | + COUNT=0
portuscontainer                     | + RETRY=1
portuscontainer                     | + '[' 1 -ne 0 ']'
portuscontainer                     | + case $(portusctl exec rails r /srv/Portus/bin/check_db.rb | grep DB) in
portuscontainer                     | ++ portusctl exec rails r /srv/Portus/bin/check_db.rb
portuscontainer                     | ++ grep DB
portuscontainer                     | + '[' 1 -eq 1 ']'
portuscontainer                     | + echo 'Initializing database'
portuscontainer                     | + portusctl exec rake db:setup
portuscontainer                     | Initializing database
portuscontainer                     | Database 'portus_production' already exists
portuscontainer                     | rake aborted!
portuscontainer                     | ActiveRecord::ProtectedEnvironmentError: You are attempting to run a destructive action against your 'production' database.
portuscontainer                     | If you are sure you want to continue, run the same command with the environment variable:
portuscontainer                     | DISABLE_DATABASE_ENVIRONMENT_CHECK=1
portuscontainer                     | /srv/Portus/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/tasks/database_tasks.rb:61:in `check_protected_environments!'
portuscontainer                     | /srv/Portus/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/railties/databases.rake:13:in `block (2 levels) in '
portuscontainer                     | /srv/Portus/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/railties/databases.rake:262:in `block (3 levels) in '
portuscontainer                     | /srv/Portus/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/exe/rake:27:in `'
portuscontainer                     | Tasks: TOP => db:schema:load => db:check_protected_environments
portuscontainer                     | (See full trace by running task with --trace)
portuscontainer                     | [schema] Selected the schema for mysql
portuscontainer                     |    (0.4ms)  SET NAMES utf8,  @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'),  @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
portuscontainer                     | [Mailer config] Host:     portus.pegasusio.io
portuscontainer                     | [Mailer config] Protocol: https://

# --
export RAILS_ENV=production

/usr/bin/gem.ruby2.6 uninstall bundler --version '<1.17.3'
/usr/bin/gem.ruby2.6 install bundler --version '1.16.4'
bundle install --deployment

# and instead of :
# ./bin/rails db:environment:set RAILS_ENV=production

# I run :
# export PORTUS_SECRET_KEY_BASE=$(cat /secrets/rails/portus.secret.key.base)
export PORTUS_SECRET_KEY_BASE=$(cat $PORTUS_SECRET_KEY_BASE_FILE)
./bin/rails db:environment:set RAILS_ENV=production
Jean-Baptiste-Lasselle commented 4 years ago

https://medium.com/@0xcolby/debugging-a-bundler-loaderror-6e3035200435

Jean-Baptiste-Lasselle commented 4 years ago

setting up two symlinks

docker exec -it portuscontainer bash -c "export RUBY_VERSION=2.6.0 && export BUNDLER_VERSION=1.16.4 && ln -s /usr/bin/bundle.ruby\${RUBY_VERSION} /usr/lib64/ruby/gems/\${RUBY_VERSION}/gems/bundler-\${BUNDLER_VERSION}/exe/bundle"

docker exec -it portuscontainer bash -c "export RUBY_VERSION=2.6.0 && export BUNDLER_VERSION=1.16.4 && ln -s /usr/bin/bundle.ruby\${RUBY_VERSION} /usr/lib64/ruby/gems/\${RUBY_VERSION}/gems/bundler-\${BUNDLER_VERSION}/exe/"

docker exec -it portuscontainer bash -c "export RUBY_VERSION=2.6.0 && export BUNDLER_VERSION=1.16.4 && ls -allh /usr/lib64/ruby/gems/\${RUBY_VERSION}/gems/bundler-\${BUNDLER_VERSION}/exe/"

  * do it for the background process : 
```bash
docker exec -it compose_background_1 bash -c "export RUBY_VERSION=2.6.0 && export BUNDLER_VERSION=1.16.4 && mkdir -p /usr/lib64/ruby/gems/\${RUBY_VERSION}/gems/bundler-\${BUNDLER_VERSION}/exe/"

# setting up two symlinks
docker exec -it compose_background_1 bash -c "export RUBY_VERSION=2.6.0 && export BUNDLER_VERSION=1.16.4 && ln -s /usr/bin/bundle.ruby\${RUBY_VERSION} /usr/lib64/ruby/gems/\${RUBY_VERSION}/gems/bundler-\${BUNDLER_VERSION}/exe/bundle"

# docker exec -it compose_background_1 bash -c "export RUBY_VERSION=2.6.0 && export BUNDLER_VERSION=1.16.4 && ln -s /usr/bin/bundle.ruby\${RUBY_VERSION} /usr/lib64/ruby/gems/\${RUBY_VERSION}/gems/bundler-\${BUNDLER_VERSION}/exe/"

docker exec -it compose_background_1 bash -c "export RUBY_VERSION=2.6.0 && export BUNDLER_VERSION=1.16.4 && ls -allh /usr/lib64/ruby/gems/\${RUBY_VERSION}/gems/bundler-\${BUNDLER_VERSION}/exe/"
docker-compose down && docker system prune -f --volumes && sudo rm -fr /var/lib/portus && docker-compose up -d --force-recreate && docker-compose logs -f portus
Jean-Baptiste-Lasselle commented 4 years ago

Victory https://www.youtube.com/watch?v=rY0WxgSXdEE&list=RD0p_1QSUsbsM&index=23

Even Clair Works GREAAAAT :D

Even Clair Works GREAAAAT

any body find meeeeeee sme-body - to love

My beloved rocket.chat

rookiedookie image

Just for the pleasure : the clair scanner report received by the background

background_1                        | [clair.post] Handling code: 201
background_1                        | [clair.post] Handling code: 201
background_1                        | [clair.post] Handling code: 201
background_1                        | [clair.post] Handling code: 201
background_1                        | [clair.post] Handling code: 201
background_1                        | [clair.get] {"Layer"=>{"Name"=>"sha256:8c55d609fb28eb8bfb52fdcfa42f5be3bf7b695d53abff2f2eff2b0ddb220ec5", "NamespaceName"=>"debian:8", "ParentName"=>"sha256:ef5c57c9ae200f221a4358b22c0301bc59f9a83e392f9787f7079a6df14e3171", "IndexedByVersion"=>3, "Features"=>[{"Name"=>"slang2", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2.3.0-2", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"curl", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"7.38.0-4+deb8u16", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"util-linux", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2.25.2-6", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"systemd", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"215-17+deb8u13", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"libcap2", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1:2.24-8", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"libsemanage", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2.3-1", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"pcre3", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2:8.35-3.3+deb8u4", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"dpkg", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.17.27", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"gmp", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2:6.0.0+dfsg-6", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"debianutils", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"4.4", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"coreutils", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"8.23-4", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"grep", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2.20-4.1", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"gzip", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.6-4", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"krb5", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.12.1+dfsg-19+deb8u5", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"cyrus-sasl2", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2.1.26.dfsg1-13+deb8u2", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"debconf", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.5.56+deb8u1", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"base-passwd", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"3.5.37", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"cryptsetup", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2:1.6.6-5", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"init-system-helpers", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.22", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"libtasn1-6", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"4.2-3+deb8u3", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"ncurses", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"5.9+20140913-1+deb8u3", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"p11-kit", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"0.20.7-1", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"debian-archive-keyring", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2017.5~deb8u1", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"lsb", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"4.1+Debian13+nmu1", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"fonts-dejavu", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2.34-1", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"gnupg", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.4.18-7+deb8u5", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"tar", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.27.1-2+deb8u2", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"mawk", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.3.3-17", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"cdebconf", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"0.192", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"adduser", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"3.113+nmu3", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"ca-certificates", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"20141019+deb8u4", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"perl", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"5.20.2-3+deb8u12", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"openssl", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.0.1t-1+deb8u12", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"glibc", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2.19-18+deb8u10", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"tzdata", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2019c-0+deb8u1", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"bash", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"4.3-11+deb8u2", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"ustr", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.0.4-3", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"apt", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.0.9.8.5", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"libtext-wrapi18n-perl", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"0.06-7", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"freetype", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2.5.2-3+deb8u4", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"gnutls28", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"3.3.30-0+deb8u1", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"libpng", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.2.50-2+deb8u3", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"insserv", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.14.0-5", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"libtext-iconv-perl", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.7-5", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"libssh2", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.4.3-4.1+deb8u6", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"openldap", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2.4.40+dfsg-1+deb8u5", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"keyutils", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.5.9-5", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"bzip2", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.0.6-7+deb8u2", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"startpar", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"0.59-3", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"sed", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"4.2.2-4+deb8u1", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"acl", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2.2.52-2", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"attr", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1:2.4.47-2", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"libselinux", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2.3-2", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"findutils", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"4.4.2-9", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"libsepol", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2.3-2", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"dash", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"0.5.7-4", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"kmod", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"18-3", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"readline6", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"6.3-8", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"shadow", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1:4.2-3+deb8u4", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"expat", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2.1.0-6+deb8u6", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"libgpg-error", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.17-3", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"hostname", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"3.15", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"ucf", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"3.0030", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"db5.3", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"5.3.28-9+deb8u1", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"libgcrypt20", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.6.3-2+deb8u8", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"gcc-4.8", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"4.8.4-1", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"base-files", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"8+deb8u11", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"xz-utils", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"5.1.1alpha+20120614-2", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"nettle", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2.7.1-5+deb8u2", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"gcc-4.9", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"4.9.2-10+deb8u2", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"libffi", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"3.1-2+deb8u1", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"libtext-charwidth-perl", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"0.04-7", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"lvm2", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2.02.111-2.2+deb8u1", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"e2fsprogs", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.42.12-2+deb8u1", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"libusb", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2:0.1.12-25", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"sysvinit", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2.88dsf-59", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"audit", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1:2.4-1", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"rtmpdump", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2.4+20150115.gita107cef-1+deb8u1", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"libidn", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.29-1+deb8u3", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"fontconfig", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2.11.0-6.3+deb8u1", "AddedBy"=>"sha256:1bfd3c6c4b4bdf97361dbb129632e04d7ade758e8ae98b5be06f5b98b011c5d3"}, {"Name"=>"pam", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.1.8-3.1+deb8u2", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"zlib", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1:1.2.8.dfsg-2+deb8u1", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"liblocale-gettext-perl", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1.05-8", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"diffutils", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"1:3.3-1", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"sensible-utils", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"0.0.9+deb8u1", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}, {"Name"=>"procps", "NamespaceName"=>"debian:8", "VersionFormat"=>"dpkg", "Version"=>"2:3.3.9-9+deb8u1", "AddedBy"=>"sha256:ad10394a96ec2ef0a20a97cf25199c27e8251f0a596a02431d18fee7d5e4f534"}]}}
background_1                        |    (0.6ms)  BEGIN
background_1                        |   Tag Load (0.6ms)  SELECT  `tags`.* FROM `tags` WHERE `tags`.`id` = 2 LIMIT 1

The not-repaired but modified /init script

#!/bin/bash

# --------------------------------------------
# --------------------------------------------
# -----  POKUS PORTUS FIX
# -----  issue fixed :
# -----  https://github.com/SUSE/Portus/issues/2241
# --------------------------------------------
# --------------------------------------------
# ------  FIX short description
# ---
# --- Goal I had : Do not change the OpenSUSE
# --- package based installation of Portus and
# --- its dependencies, here the Ruby related packages
# --- Because they work hard on packages to be the best suited for the underlying OS.
# ---
# --- I designed the fix based on the closest
# --- issue I found on other ruby stacked
# --- projects on github.com :
# ---
# ---  https://github.com/rubygems/rubygems/issues/2180#issuecomment-365263622
# ---
# --- 1./ The issue is that the
# ---     OpenSUSE installed package expects
# ---     the 'bundle' executable at a path
# ---     that does not exist;
# ---     So we use a symlink to fix that
# ---
# --- 2./ The issue is that the
# ---     OpenSUSE installed package expects
# ---     the 'bundle' executable at a path
# ---     that does not exist; But I noticed
# ---     that this path is using the 'bundle'
# ---     executable version number.
# ---     So I searched the system, to find
# ---     out what version of bundle was installed
# ---     by the openSUSE Ruby-packages.
# ---     Answer was (dockerhub 'opensuse/portus:2.5')
# ---     version '1.16.4'. So I uninstalled the bundle/bundler twins
# ---
# ---     Also, paths referenced by the https://github.com/rubygems/rubygems/issues/2180#issuecomment-365263622
# ---     were debian specific, so I had to modify
# ---     them, to match OpenSUSE Leap file system
# ---     layout :
# ---
# ---     for example '/usr/lib64/ ...'
# ---     instead of  '/usr/lib/ ...'
# ---     (typical layout customisation for virtualization / containerization)
# --------------------------------------------
# --------------------------------------------
# --------------------------------------------

export RUBY_MAJOR_VERSION=2
export RUBY_MINOR_VERSION=6
export RUBY_VERSION="${RUBY_MAJOR_VERSION}.${RUBY_MINOR_VERSION}.0"

export RAKE_VERSION=12.3.2
# so GEM_PATH should be set to ... ?
export BUNDLER_VERSION=1.16.4

# export RAILS_ENV=production

/usr/bin/gem.ruby2.6 uninstall bundle --version '<1.17.3'
/usr/bin/gem.ruby2.6 install bundle --version '1.16.4'

/usr/bin/gem.ruby2.6 uninstall bundler --version '<1.17.3'
/usr/bin/gem.ruby2.6 install bundler --version '1.16.4'

# ----
# Symlink repairing missing path :
#  /usr/lib64/ruby/gems/${RUBY_VERSION}/gems/bundler-${BUNDLER_VERSION}/exe/
#
#
mkdir -p /usr/lib64/ruby/gems/${RUBY_VERSION}/gems/bundler-${BUNDLER_VERSION}/exe/

# because on opensuse Leap_15.1 , the
# ruby bundle executable is at [/usr/bin/bundle.ruby2.6], not at
# [/var/lib/gems/${RUBY_VERSION}/gems ...]
ln -s /usr/bin/bundle.ruby${RUBY_MAJOR_VERSION}.${RUBY_MINOR_VERSION} /usr/lib64/ruby/gems/${RUBY_VERSION}/gems/bundler-${BUNDLER_VERSION}/exe/bundle
ln -s /usr/bin/bundler.ruby${RUBY_MAJOR_VERSION}.${RUBY_MINOR_VERSION} /usr/lib64/ruby/gems/${RUBY_VERSION}/gems/bundler-${BUNDLER_VERSION}/exe/bundler
# ln -s /usr/bin/ruby.ruby${RUBY_MAJOR_VERSION}.${RUBY_MINOR_VERSION} /usr/lib64/ruby/gems/${RUBY_VERSION}/gems/bundler-${BUNDLER_VERSION}/exe/ruby
# ln -s /usr/bin/rake.ruby${RUBY_MAJOR_VERSION}.${RUBY_MINOR_VERSION} /usr/lib64/ruby/gems/${RUBY_VERSION}/gems/bundler-${BUNDLER_VERSION}/exe/rake
# ln -s /usr/bin/gem.ruby${RUBY_MAJOR_VERSION}.${RUBY_MINOR_VERSION} /usr/lib64/ruby/gems/${RUBY_VERSION}/gems/bundler-${BUNDLER_VERSION}/exe/gem

# echo '' > /pokus.portus.issue.2241.fix
# echo 'oui jai bien ete execute tres cher' > /pokus.portus.issue.2241.fix
# echo '' > /pokus.portus.issue.2241.fix
# echo "contenu de []"
# ls -allh /usr/lib64/ruby/gems/${RUBY_VERSION}/gems/rake-${RAKE_VERSION}/exe/rake > /pokus.portus.issue.2241.fix
# echo "répertoire créé : [/usr/lib64/ruby/gems/${RUBY_VERSION}/gems/bundler-${BUNDLER_VERSION}/exe/]" > /pokus.portus.issue.2241.fix
# echo "chemin executable ruby : [/usr/bin/bundle.ruby${RUBY_MAJOR_VERSION}.${RUBY_MINOR_VERSION}]" > /pokus.portus.issue.2241.fix
# echo " [/usr/bin/bundle.ruby${RUBY_MAJOR_VERSION}.${RUBY_MINOR_VERSION}] est mappé sur : [/usr/lib64/ruby/gems/${RUBY_VERSION}/gems/bundler-${BUNDLER_VERSION}/exe/bundle]" > /pokus.portus.issue.2241.fix
# echo "chemin executable ruby : [/usr/bin/bundler.ruby${RUBY_MAJOR_VERSION}.${RUBY_MINOR_VERSION}]" > /pokus.portus.issue.2241.fix
# echo " [/usr/bin/bundler.ruby${RUBY_MAJOR_VERSION}.${RUBY_MINOR_VERSION}] mappé sur : [/usr/lib64/ruby/gems/${RUBY_VERSION}/gems/bundler-${BUNDLER_VERSION}/exe/bundler]" > /pokus.portus.issue.2241.fix

# --------------------------------------------------
# This script will ensure Portus' database is ready to be used. It will keep
# waiting for the db to be usable, but the script will exit with an error
# after a certain amount of failed attempts.
#
# The script will automatically import all the SSL certificates from
# `/certificates` into the final system. This is needed to talk with the
# registry API when this one is protected by TLS.
#
# Finally the script will start apache running Portus via mod_rails.

set -e

wait_for_database() {
  should_setup=${1:-0}

  TIMEOUT=90
  COUNT=0
  RETRY=1

  while [ $RETRY -ne 0 ]; do
    case $(portusctl exec --vendor rails r /srv/Portus/bin/check_db.rb | grep DB) in
      "DB_DOWN")
        if [ "$COUNT" -ge "$TIMEOUT" ]; then
          printf " [FAIL]\n"
          echo "Timeout reached, exiting with error"
          exit 1
        fi
        echo "Waiting for mariadb to be ready in 5 seconds"
        sleep 5
        COUNT=$((COUNT+5))
        ;;
      "DB_EMPTY"|"DB_MISSING")
        if [ $should_setup -eq 1 ]; then
          # create db, apply schema and seed
          echo "Initializing database"
          portusctl exec --vendor rake db:setup
          if [ $? -ne 0 ]; then
            echo "Error at setup time"
            exit 1
          fi
        fi
        ;;
      "DB_READY")
        echo "Database ready"
        break
        ;;
    esac
  done
  set -e
}

setup_database() {
  wait_for_database 1
}

# Usage: file_env 'XYZ_DB_PASSWORD' 'example'. This code is taken from:
# https://github.com/docker-library/postgres/blob/master/docker-entrypoint.sh
file_env() {
    local var="$1"
    local fileVar="${var}_FILE"
    if [ -v "${var}" ] && [ -v "${fileVar}" ]; then
        echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
        exit 1
    fi
    if [ -v "${fileVar}" ]; then
        val="$(< "${!fileVar}")"
        export "$var"="$val"
    fi
    unset "$fileVar"
}

# Setup environment variables from secrets.
secrets=( PORTUS_DB_PASSWORD PORTUS_PASSWORD PORTUS_SECRET_KEY_BASE
          PORTUS_EMAIL_SMTP_PASSWORD PORTUS_LDAP_AUTHENTICATION_PASSWORD )
for s in "${secrets[@]}"; do
    if [[ -z "${!s}" ]]; then
        file_env "$s"
    fi
done

# Ensure additional certificates (e.g. docker registry) are known.
update-ca-certificates

# Further settings
export PORTUS_PUMA_HOST="0.0.0.0:3000"
export RACK_ENV="production"
export RAILS_ENV="production"
export CCONFIG_PREFIX="PORTUS"

if [ -z "$PORTUS_GEM_GLOBAL" ]; then
    export GEM_PATH="/srv/Portus/vendor/bundle/ruby/2.6.0"
fi

# On debug, print the environment in which we'll call Portus.
if [ "$PORTUS_LOG_LEVEL" == "debug" ]; then
    printenv
fi

# Go to the Portus directory and execute the proper command.
cd /srv/Portus
if [ ! -z "$PORTUS_BACKGROUND" ]; then
    wait_for_database
    portusctl exec --vendor rails r /srv/Portus/bin/background.rb
elif [ -z "$PORTUS_INIT_COMMAND" ]; then
    setup_database
    portusctl exec --vendor "pumactl -F /srv/Portus/config/puma.rb start"
else
    wait_for_database
    portusctl exec --vendor "$PORTUS_INIT_COMMAND"
fi