LoginSignup
0
0

More than 3 years have passed since last update.

openshift4.3でlaravelする

Last updated at Posted at 2020-03-07

はじめに

openshift3.11を利用中でしたが、openshift4.3に触れてみようと始めたminishiftのインストール。
名前も変わってCODEREADY CONTAINERS 1.6。そして、あまりのGUIの変化についていけないところですが、これから頑張りたいと思います(笑)

まずは在り来たりのlaravelをopenshift4.3で起動するところまでやってみたいと思います。

CODEREADY CONTAINERS 1.6のインストール

新規にインストールする際はこちらを参考にどうぞ。
CentOS7にOpenShift4(Red Hat CodeReady Containers)をインストールする

アップデートするならこちらからどうぞ。
CentOS7にOpenShift4を4.2から4.3にUpdateする

CODEREADY CONTAINERS 1.6の起動

crc startで起動できます。

最後に警告がでていますが、気にせずいきます。
i5-3470Sでは限界かもしれません(笑)

[tak@minishift4 ~]$ crc start
INFO Checking if oc binary is cached              
INFO Checking if running as non-root              
INFO Checking if Virtualization is enabled        
INFO Checking if KVM is enabled                   
INFO Checking if libvirt is installed             
INFO Checking if user is part of libvirt group    
INFO Checking if libvirt is enabled               
INFO Checking if libvirt daemon is running        
INFO Checking if a supported libvirt version is installed 
INFO Checking if crc-driver-libvirt is installed  
INFO Checking if libvirt 'crc' network is available 
INFO Checking if libvirt 'crc' network is active  
INFO Checking if NetworkManager is installed      
INFO Checking if NetworkManager service is running 
INFO Checking if /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf exists 
INFO Checking if /etc/NetworkManager/dnsmasq.d/crc.conf exists 
INFO Starting CodeReady Containers VM for OpenShift 4.3.0... 
INFO Verifying validity of the cluster certificates ... 
INFO Check internal and public DNS query ...      
INFO Check DNS query from host ...                
INFO Starting OpenShift cluster ... [waiting 3m]  
INFO                                              
INFO To access the cluster, first set up your environment by following 'crc oc-env' instructions 
INFO Then you can access it by running 'oc login -u developer -p developer https://api.crc.testing:6443' 
INFO To login as an admin, run 'oc login -u kubeadmin -p 7z6T5-qmTth-oxaoD-p3xQF https://api.crc.testing:6443' 
INFO                                              
INFO You can now run 'crc console' and use these credentials to access the OpenShift web console 
Started the OpenShift cluster
WARN The cluster might report a degraded or error state. This is expected since several operators have been disabled to lower the resource usage. For more information, please consult the documentation 

起動したらコンソールを呼び出します。

crc consoleで呼び出します。

[tak@minishift4 ~]$ crc console
Opening the OpenShift Web Console in the default browser...
This tool has been deprecated, use 'gio open' instead.
See 'gio help open' for more info.

2020-03-07.png

コンソールに入るには「htpasswd_provider」を選択し、スタートアップ時に表示されていたユーザ「developer/develoer」でログインします。

2020-03-07 (1).png

2020-03-07 (2).png

Projectの作成

まずはProjectを作成します。この辺の概念はopenshift3.xと同様ですね。

2020-03-07 (2).png

2020-03-07 (3).png

2020-03-07 (4).png

ここで左上のプルダウンには「Administrator」と「Developer」が選択できます。
Projectの詳細を変更するには「Administrator」、ProjectにPodを作るなどは「Developer」を選択します。

Application(Pod?)の作成

ProjectができたらContainer(Pod)を作成していきます。
「Developer」に切り替えて3.xにあった「From Catalog」からPHPを選択します。

2020-03-07 (6).png

2020-03-07 (7).png

2020-03-07 (8).png

今回は単純なPHPを選択しました。

2020-03-07 (9).png

「Create Application」から

2020-03-07 (10).png

GitのURLですが、sampleでもよいのですがlaravelをやってみたいのでこちらを入力しました。
このGit、laravelのProjectを作っただけの素の状態となります。

https://gitlab.com/imp555/laravel5.8.git

2020-03-07 (11).png

この辺りはGitから勝手に生成されていたので、そのままとしました。
このNameを変えるとURLを変更できるみたいです。

2020-03-07 (12).png
2020-03-07 (13).png

で「Create」を押すと見慣れない「Topology」画面が表示されます。

2020-03-07 (14).png

この「Topology」画面でContenerを選択すると詳細が右側に表示されます。

2020-03-07 (15).png

ちなみにContenerのURLはName-Projectとなるようですね。
今回の場合、http://laravel-git-laravel.apps-crc.testing/となっていました。

この画面でじっと待っていてもよいのですが、不安なのでログを見たいと思います。
Builds #1のView logsをクリックします。

2020-03-07 (16).png

処理が進んでいるのが見れてちょっと安心(笑)
Push successfulが出れば正常にPodが作成されます。

2020-03-07 (17).png

Build時は薄い青でしたが、少し濃いめの青になりPodが稼働しています。

ApplicationのURLにアクセスする

Topologyに表示されるApplicationの右上のアイコンをクリックするとURLでアクセスできます。

2020-03-07 (18).png

作ったのはLaravelなので、DocumentRootが/ではなく/publicだからでしょうか。

URLを/publicにしてみます。

2020-03-07 (19).png

はい。Laravel色の500番エラー画面がでて、Laravelが起動していることが分かります(笑)

Podのログを確認する

Podのログを確認します。
PodsのView logsからアクセスします。
2020-03-07 (21).png

2020-03-07 (22).png

/publicから301でリダイレクトされて/public/に行って500番。
特に有益な情報は得られませんでした…。

PodにTerminalアクセスする

TerminalでPodの状態を確認します。

2020-03-07 (23).png

原因判明。
.envファイルも、Vendorフォルダもありませんね…。
composerが動作していない様子。

うぅ~ん。どうしたらよいのだろうか(笑)
Gitに.envVendor/も入れれば動くでしょうが、環境設定駄々洩れになるしね…。
Composerが動作していないところをどうにかしないといけないなぁ

今日のところはこのくらいで(^^)/

翌日談

もう一度BuildしなおしてみたらComposerは動作しているようでした。
あとは.env作ってphp artisan key:generateすれば動作はしそうです。

Build時のLog

Cloning "https://gitlab.com/imp555/laravel.git" ...
    Commit: c42f6d03cbd0217c0d3f0af930eebc5020d229d6 (laravel 5.8.35)
    Author: imp555
    Date:   Sat Mar 7 22:06:07 2020 +0900
Caching blobs under "/var/cache/blobs".
Getting image source signatures
Copying blob sha256:455ea8ab06218495bbbcb14b750a0d644897b24f8c5dcf9e8698e27882583412
Copying blob sha256:01ace4f1c1164bbc4513b616c5cff62585fde1dc198b7469c5bc5bc5355941da
Copying blob sha256:bb13d92caffa705f32b8a7f9f661e07ddede310c6ccfa78fb53a49539740e29b
Copying blob sha256:1d12b9a95cbaf32ab3bcb4a98f70e9e149e72000e86abc04c22ac495c8a70a15
Copying blob sha256:84e620d0abe585d05a7bed55144af0bc5efe083aed05eac1e88922034ddf1ed2
Copying config sha256:e0d2bc51569c2e3832781d6d8038cdb9af4322c0018f0072d76a402b8373a37f
Writing manifest to image destination
Storing signatures
Generating dockerfile with builder image image-registry.openshift-image-registry.svc:5000/openshift/php@sha256:a5aaaae5baf98cb674ac2352429e0450591b45d3674e44c516612a9ee67282d5
STEP 1: FROM image-registry.openshift-image-registry.svc:5000/openshift/php@sha256:a5aaaae5baf98cb674ac2352429e0450591b45d3674e44c516612a9ee67282d5
STEP 2: LABEL "io.openshift.build.commit.date"="Sat Mar 7 22:06:07 2020 +0900" "io.openshift.build.commit.id"="c42f6d03cbd0217c0d3f0af930eebc5020d229d6" "io.openshift.build.commit.ref"="HEAD" "io.openshift.build.commit.message"="laravel 5.8.35" "io.openshift.build.source-location"="https://gitlab.com/imp555/laravel.git" "io.openshift.build.source-context-dir"="/" "io.openshift.build.image"="image-registry.openshift-image-registry.svc:5000/openshift/php@sha256:a5aaaae5baf98cb674ac2352429e0450591b45d3674e44c516612a9ee67282d5" "io.openshift.build.commit.author"="imp555 <t.kitasuka@gmail.com>"
STEP 3: ENV OPENSHIFT_BUILD_NAME="laravel-git-2" OPENSHIFT_BUILD_NAMESPACE="laravel" OPENSHIFT_BUILD_SOURCE="https://gitlab.com/imp555/laravel.git" OPENSHIFT_BUILD_COMMIT="c42f6d03cbd0217c0d3f0af930eebc5020d229d6"
STEP 4: USER root
STEP 5: COPY upload/src /tmp/src
STEP 6: RUN chown -R 1001:0 /tmp/src
STEP 7: USER 1001
STEP 8: RUN /usr/libexec/s2i/assemble
---> Installing application source...
Found 'composer.json', installing dependencies using composer.phar... 
Downloading https://getcomposer.org/installer, attempt 1/6
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0 76  270k   76  207k    0     0   111k      0  0:00:02  0:00:01  0:00:01  111k100  270k  100  270k    0     0   143k      0  0:00:01  0:00:01 --:--:--  143k
All settings correct for using Composer
Downloading...

Composer (version 1.9.3) successfully installed to: /opt/app-root/src/composer.phar
Use it: php composer.phar

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 81 installs, 0 updates, 0 removals
  - Installing doctrine/inflector (1.3.1): Downloading (100%)
  - Installing doctrine/lexer (1.0.2): Downloading (100%)
  - Installing dragonmantank/cron-expression (v2.3.0): Downloading (100%)
  - Installing erusev/parsedown (1.7.4): Downloading (100%)
  - Installing symfony/polyfill-ctype (v1.14.0): Downloading (100%)
  - Installing phpoption/phpoption (1.7.2): Downloading (100%)
  - Installing vlucas/phpdotenv (v3.6.0): Downloading (100%)
  - Installing symfony/css-selector (v4.4.5): Downloading (100%)
  - Installing tijsverkoyen/css-to-inline-styles (2.2.2): Downloading (100%)
  - Installing symfony/polyfill-php72 (v1.14.0): Downloading (100%)
  - Installing symfony/polyfill-mbstring (v1.14.0): Downloading (100%)
  - Installing symfony/var-dumper (v4.4.5): Downloading (100%)
  - Installing symfony/routing (v4.4.5): Downloading (100%)
  - Installing symfony/process (v4.4.5): Downloading (100%)
  - Installing symfony/polyfill-php73 (v1.14.0): Downloading (100%)
  - Installing symfony/polyfill-intl-idn (v1.14.0): Downloading (100%)
  - Installing symfony/mime (v4.4.5): Downloading (100%)
  - Installing symfony/http-foundation (v4.4.5): Downloading (100%)
  - Installing symfony/event-dispatcher-contracts (v1.1.7): Downloading (100%)
  - Installing symfony/event-dispatcher (v4.4.5): Downloading (100%)
  - Installing psr/log (1.1.2): Downloading (100%)
  - Installing symfony/debug (v4.4.5): Downloading (100%)
  - Installing symfony/error-handler (v4.4.5): Downloading (100%)
  - Installing symfony/http-kernel (v4.4.5): Downloading (100%)
  - Installing symfony/finder (v4.4.5): Downloading (100%)
  - Installing psr/container (1.0.0): Downloading (100%)
  - Installing symfony/service-contracts (v1.1.8): Downloading (100%)
  - Installing symfony/console (v4.4.5): Downloading (100%)
  - Installing symfony/polyfill-iconv (v1.14.0): Downloading (100%)
  - Installing egulias/email-validator (2.1.17): Downloading (100%)
  - Installing swiftmailer/swiftmailer (v6.2.3): Downloading (100%)
  - Installing paragonie/random_compat (v9.99.99): Downloading (100%)
  - Installing ramsey/uuid (3.9.3): Downloading (100%)
  - Installing psr/simple-cache (1.0.1): Downloading (100%)
  - Installing opis/closure (3.5.1): Downloading (100%)
  - Installing symfony/translation-contracts (v1.1.7): Downloading (100%)
  - Installing symfony/translation (v4.4.5): Downloading (100%)
  - Installing nesbot/carbon (2.31.0): Downloading (100%)
  - Installing monolog/monolog (1.25.3): Downloading (100%)
  - Installing league/flysystem (1.0.46): Downloading (100%)
  - Installing laravel/framework (v5.8.37): Downloading (100%)
  - Installing fideloper/proxy (4.3.0): Downloading (100%)
  - Installing jakub-onderka/php-console-color (v0.2): Downloading (100%)
  - Installing nikic/php-parser (v4.3.0): Downloading (100%)
  - Installing jakub-onderka/php-console-highlighter (v0.4): Downloading (100%)
  - Installing dnoegel/php-xdg-base-dir (v0.1.1): Downloading (100%)
  - Installing psy/psysh (v0.9.12): Downloading (100%)
  - Installing laravel/tinker (v1.0.10): Downloading (100%)
  - Installing beyondcode/laravel-dump-server (1.3.0): Downloading (100%)
  - Installing fzaninotto/faker (v1.9.1): Downloading (100%)
  - Installing hamcrest/hamcrest-php (v2.0.0): Downloading (100%)
  - Installing mockery/mockery (1.3.1): Downloading (100%)
  - Installing filp/whoops (2.7.1): Downloading (100%)
  - Installing nunomaduro/collision (v3.0.1): Downloading (100%)
  - Installing webmozart/assert (1.7.0): Downloading (100%)
  - Installing phpdocumentor/reflection-common (2.0.0): Downloading (100%)
  - Installing phpdocumentor/type-resolver (1.0.1): Downloading (100%)
  - Installing phpdocumentor/reflection-docblock (4.3.4): Downloading (100%)
  - Installing phpunit/php-token-stream (3.1.1): Downloading (100%)
  - Installing sebastian/version (2.0.1): Downloading (100%)
  - Installing sebastian/resource-operations (2.0.1): Downloading (100%)
  - Installing sebastian/recursion-context (3.0.0): Downloading (100%)
  - Installing sebastian/object-reflector (1.1.1): Downloading (100%)
  - Installing sebastian/object-enumerator (3.0.3): Downloading (100%)
  - Installing sebastian/global-state (2.0.0): Downloading (100%)
  - Installing sebastian/exporter (3.1.2): Downloading (100%)
  - Installing sebastian/environment (4.2.3): Downloading (100%)
  - Installing sebastian/diff (3.0.2): Downloading (100%)
  - Installing sebastian/comparator (3.0.2): Downloading (100%)
  - Installing phpunit/php-timer (2.1.2): Downloading (100%)
  - Installing phpunit/php-text-template (1.2.1): Downloading (100%)
  - Installing phpunit/php-file-iterator (2.0.2): Downloading (100%)
  - Installing theseer/tokenizer (1.1.3): Downloading (100%)
  - Installing sebastian/code-unit-reverse-lookup (1.0.1): Downloading (100%)
  - Installing phpunit/php-code-coverage (6.1.4): Downloading (100%)
  - Installing doctrine/instantiator (1.3.0): Downloading (100%)
  - Installing phpspec/prophecy (v1.10.3): Downloading (100%)
  - Installing phar-io/version (2.0.1): Downloading (100%)
  - Installing phar-io/manifest (1.0.3): Downloading (100%)
  - Installing myclabs/deep-copy (1.9.5): Downloading (100%)
  - Installing phpunit/phpunit (7.5.20): Downloading (100%)
symfony/routing suggests installing doctrine/annotations (For using the annotation loader)
symfony/routing suggests installing symfony/config (For using the all-in-one router or any loader)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
symfony/routing suggests installing symfony/yaml (For using the YAML loader)
symfony/event-dispatcher-contracts suggests installing psr/event-dispatcher
symfony/event-dispatcher suggests installing symfony/dependency-injection
symfony/http-kernel suggests installing symfony/browser-kit
symfony/http-kernel suggests installing symfony/config
symfony/http-kernel suggests installing symfony/dependency-injection
symfony/service-contracts suggests installing symfony/service-implementation
symfony/console suggests installing symfony/lock
swiftmailer/swiftmailer suggests installing true/punycode (Needed to support internationalized email addresses, if ext-intl is not installed)
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
ramsey/uuid suggests installing ext-libsodium (Provides the PECL libsodium extension for use with the SodiumRandomGenerator)
ramsey/uuid suggests installing ext-uuid (Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator)
ramsey/uuid suggests installing moontoast/math (Provides support for converting UUID to 128-bit integer (in string form).)
ramsey/uuid suggests installing paragonie/random-lib (Provides RandomLib for use with the RandomLibAdapter)
ramsey/uuid suggests installing ramsey/uuid-console (A console application for generating UUIDs with ramsey/uuid)
ramsey/uuid suggests installing ramsey/uuid-doctrine (Allows the use of Ramsey\Uuid\Uuid as Doctrine field type.)
symfony/translation suggests installing symfony/config
symfony/translation suggests installing symfony/yaml
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing sentry/sentry (Allow sending log messages to a Sentry server)
league/flysystem suggests installing league/flysystem-aws-s3-v2 (Allows you to use S3 storage with AWS SDK v2)
league/flysystem suggests installing league/flysystem-aws-s3-v3 (Allows you to use S3 storage with AWS SDK v3)
league/flysystem suggests installing league/flysystem-azure (Allows you to use Windows Azure Blob storage)
league/flysystem suggests installing league/flysystem-cached-adapter (Flysystem adapter decorator for metadata caching)
league/flysystem suggests installing league/flysystem-eventable-filesystem (Allows you to use EventableFilesystem)
league/flysystem suggests installing league/flysystem-rackspace (Allows you to use Rackspace Cloud Files)
league/flysystem suggests installing league/flysystem-sftp (Allows you to use SFTP server storage via phpseclib)
league/flysystem suggests installing league/flysystem-webdav (Allows you to use WebDAV storage)
league/flysystem suggests installing league/flysystem-ziparchive (Allows you to use ZipArchive adapter)
league/flysystem suggests installing spatie/flysystem-dropbox (Allows you to use Dropbox storage)
league/flysystem suggests installing srmklive/flysystem-dropbox-v2 (Allows you to use Dropbox storage for PHP 5 applications)
laravel/framework suggests installing aws/aws-sdk-php (Required to use the SQS queue driver and SES mail driver (^3.0).)
laravel/framework suggests installing doctrine/dbal (Required to rename columns and drop SQLite columns (^2.6).)
laravel/framework suggests installing guzzlehttp/guzzle (Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (^6.0).)
laravel/framework suggests installing league/flysystem-aws-s3-v3 (Required to use the Flysystem S3 driver (^1.0).)
laravel/framework suggests installing league/flysystem-cached-adapter (Required to use the Flysystem cache (^1.0).)
laravel/framework suggests installing league/flysystem-rackspace (Required to use the Flysystem Rackspace driver (^1.0).)
laravel/framework suggests installing league/flysystem-sftp (Required to use the Flysystem SFTP driver (^1.0).)
laravel/framework suggests installing moontoast/math (Required to use ordered UUIDs (^1.1).)
laravel/framework suggests installing nexmo/client (Required to use the Nexmo transport (^1.0).)
laravel/framework suggests installing pda/pheanstalk (Required to use the beanstalk queue driver (^4.0).)
laravel/framework suggests installing predis/predis (Required to use the redis cache and queue drivers (^1.0).)
laravel/framework suggests installing pusher/pusher-php-server (Required to use the Pusher broadcast driver (^3.0).)
laravel/framework suggests installing symfony/dom-crawler (Required to use most of the crawler integration testing tools (^4.2).)
laravel/framework suggests installing symfony/psr-http-message-bridge (Required to use PSR-7 bridging features (^1.1).)
laravel/framework suggests installing wildbit/swiftmailer-postmark (Required to use Postmark mail driver (^3.0).)
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)
filp/whoops suggests installing whoops/soap (Formats errors as SOAP responses)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.6.0)
phpunit/phpunit suggests installing ext-xdebug (*)
phpunit/phpunit suggests installing phpunit/php-invoker (^2.0)
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: [32mbeyondcode/laravel-dump-server[39m
Discovered Package: [32mfideloper/proxy[39m
Discovered Package: [32mlaravel/tinker[39m
Discovered Package: [32mnesbot/carbon[39m
Discovered Package: [32mnunomaduro/collision[39m
[32mPackage manifest generated successfully.[39m
=> sourcing 20-copy-config.sh ...
---> 23:19:40     Processing additional arbitrary httpd configuration provided by s2i ...
=> sourcing 00-documentroot.conf ...
=> sourcing 50-mpm-tuning.conf ...
=> sourcing 40-ssl-certs.sh ...
STEP 9: CMD /usr/libexec/s2i/run
STEP 10: COMMIT temp.builder.openshift.io/laravel/laravel-git-2:dcdcdd70
Getting image source signatures
Copying blob sha256:35817540a17b5b90cb4426078d53813b16e70c75e1cce3db116d2fbbca7fbf10
Copying blob sha256:c7fbe90ae90e9c6452e5d809f069907907e6f32532565104921f600fb956306c
Copying blob sha256:74d760a83a4b8bcb3d01e7726e06c11469f0bb2ce4645474cb91a607c27bf482
Copying blob sha256:f1cc3f0b20053e48dc0f6505734d2f476e4fcd975df9791164bd749af9332401
Copying blob sha256:c19ff85c66e8be48cab01b2574aa562291be030145d9debce919e008bb2b3c59
Copying blob sha256:d6751f0b220aac8d7347e9eb8ab3e817fcc9aa3148e9dba466af745d4420868e
Copying config sha256:b39f75b9f96b46b7bace38aa0a350585d80883f31655a44bb87a71c18f93af85
Writing manifest to image destination
Storing signatures
b39f75b9f96b46b7bace38aa0a350585d80883f31655a44bb87a71c18f93af85
b39f75b9f96b46b7bace38aa0a350585d80883f31655a44bb87a71c18f93af85

Pushing image image-registry.openshift-image-registry.svc:5000/laravel/laravel-git:latest ...
Getting image source signatures
Copying blob sha256:84e620d0abe585d05a7bed55144af0bc5efe083aed05eac1e88922034ddf1ed2
Copying blob sha256:01ace4f1c1164bbc4513b616c5cff62585fde1dc198b7469c5bc5bc5355941da
Copying blob sha256:455ea8ab06218495bbbcb14b750a0d644897b24f8c5dcf9e8698e27882583412
Copying blob sha256:1d12b9a95cbaf32ab3bcb4a98f70e9e149e72000e86abc04c22ac495c8a70a15
Copying blob sha256:bb13d92caffa705f32b8a7f9f661e07ddede310c6ccfa78fb53a49539740e29b
Copying blob sha256:d6751f0b220aac8d7347e9eb8ab3e817fcc9aa3148e9dba466af745d4420868e
Copying config sha256:b39f75b9f96b46b7bace38aa0a350585d80883f31655a44bb87a71c18f93af85
Writing manifest to image destination
Storing signatures
Successfully pushed image-registry.openshift-image-registry.svc:5000/laravel/laravel-git@sha256:27a68dba46622131290b9e01696a485524c6053894474823536dc20ea468d59c
Push successful

PodのLog

=> sourcing 20-copy-config.sh ...
---> 23:20:26     Processing additional arbitrary httpd configuration provided by s2i ...
=> sourcing 00-documentroot.conf ...
=> sourcing 50-mpm-tuning.conf ...
=> sourcing 40-ssl-certs.sh ...
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.128.0.48. Set the 'ServerName' directive globally to suppress this message
[Sat Mar 07 23:20:29.174573 2020] [ssl:warn] [pid 1] AH01909: 10.128.0.48:8443:0 server certificate does NOT include an ID which matches the server name
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.128.0.48. Set the 'ServerName' directive globally to suppress this message
[Sat Mar 07 23:20:29.316467 2020] [ssl:warn] [pid 1] AH01909: 10.128.0.48:8443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 07 23:20:29.317097 2020] [http2:warn] [pid 1] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Sat Mar 07 23:20:29.318009 2020] [lbmethod_heartbeat:notice] [pid 1] AH02282: No slotmem from mod_heartmonitor
[Sat Mar 07 23:20:30.197832 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips configured -- resuming normal operations
[Sat Mar 07 23:20:30.197901 2020] [core:notice] [pid 1] AH00094: Command line: 'httpd -D FOREGROUND'
[Sat Mar 07 23:21:04.010403 2020] [autoindex:error] [pid 46] [client 10.128.0.1:44820] AH01276: Cannot serve directory /opt/app-root/src/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
10.128.0.1 - - [07/Mar/2020:23:21:03 +0000] "GET / HTTP/1.1" 403 3985 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0"

ちゃんとlaravelするために

Laravel色の500番エラーで喜んでいましたが、ちゃんとLaravelするためにいろいろ試行錯誤しました。
結論から言うと、s2iのスクリプトを仕込んで以下の処理を追加しました。

  • documentroot/publicに設定
  • .envファイルを生成しphp artisan key:generateした後に、DB設定を環境変数から更新
  • DBを使っていればphp artisan migrate
  • php artisan storage:link

https://gitlab.com/imp555/laravel5.8-s2i.git

.s2i/bin/assenble

.s2i/bin/assemble
#!/bin/bash -e

echo "*--------------------------------------------------------------------------[ENV]"
set

echo "*---------------------------------------------------------[exec assemble script]"
source ${STI_SCRIPTS_PATH}/assemble

echo "*------------------------------------------------------------[setup laravel env]"
cp .env.example .env
php artisan key:generate
sed -i "s/DB_CONNECTION=mysql/DB_CONNECTION=${DB_CONNECTION}/g" .env
sed -i "s/DB_HOST=127\.0\.0\.1/DB_HOST=${DB_HOST}/g" .env
sed -i "s/DB_PORT=3306/DB_PORT=${DB_PORT}/g" .env
sed -i "s/DB_DATABASE=laravel/DB_DATABASE=${DB_DATABASE}/g" .env
sed -i "s/DB_USERNAME=root/DB_USERNAME=${DB_USERNAME}/g" .env
sed -i "s/DB_PASSWORD=/DB_PASSWORD=${DB_PASSWORD}/g" .env


echo "=> setup .env"


if [ "${DB_CONNECTION}" = "sqlite" ]; then
    echo "*---------------------------------------------------------[create database file]"
    touch ./database/database.sqlite
    chmod go+rw ./database/database.sqlite

    echo "=> sqlite database file created"
fi

echo "*--------------------------------------------------------------[apache settings]"
sed -i '1iHeader unset X-Powered-By' ${HTTPD_MAIN_CONF_PATH}/httpd.conf
sed -i '1iTraceEnable Off' ${HTTPD_MAIN_CONF_PATH}/httpd.conf
sed -i '1iServerSignature Off' ${HTTPD_MAIN_CONF_PATH}/httpd.conf
sed -i '1iServerTokens Prod' ${HTTPD_MAIN_CONF_PATH}/httpd.conf


sed -i 's/\/opt\/app-root\/src/\/opt\/app-root\/src\/public/g' ${HTTPD_MAIN_CONF_PATH}/httpd.conf
sed -i '/^<Directory \"\/opt\/app-root\/src\/public\">/a Require method GET POST' ${HTTPD_MAIN_CONF_PATH}/httpd.conf

sed -i 's/Options Indexes FollowSymLinks/Options FollowSymLinks/g' ${HTTPD_MAIN_CONF_PATH}/httpd.conf
rm -f ${HTTPD_MAIN_CONF_D_PATH}/autoindex.conf
rm -f ${HTTPD_MAIN_CONF_D_PATH}/welcome.conf

echo "=> apache setting changed"

echo "*-----------------------------------------------------------------[php settings]"

sed -i 's/date.timezone = GMT/date.timezone = \"Asia\/Tokyo\"/' ${APP_ROOT}/etc/php.ini.template

sed -i 's/;mbstring.language = Japanese/mbstring.language = Japanese/' ${APP_ROOT}/etc/php.ini.template
sed -i 's/;mbstring.internal_encoding =/mbstring.internal_encoding = UTF-8/' ${APP_ROOT}/etc/php.ini.template
sed -i 's/;mbstring.http_input =/mbstring.http_input = UTF-8/' ${APP_ROOT}/etc/php.ini.template
sed -i 's/;mbstring.http_output =/mbstring.http_output = pass/' ${APP_ROOT}/etc/php.ini.template
sed -i 's/;mbstring.encoding_translation = Off/mbstring.encoding_translation = On/' ${APP_ROOT}/etc/php.ini.template
sed -i 's/;mbstring.detect_order = auto/mbstring.detect_order = auto/' ${APP_ROOT}/etc/php.ini.template
sed -i 's/;mbstring.substitute_character = none/mbstring.substitute_character = none/' ${APP_ROOT}/etc/php.ini.template

echo "=> php setting changed"

.s2i/bin/run

.s2i/bin/run
#!/bin/bash -e

echo "*--------------------------------------------------------------------------[ENV]"
set

echo "*----------------------------------------------------------------[setup laravel]"
if [ "${DB_CONNECTION}" != "" ]; then
    echo "Migrating database 'php artisan migrate --force'..."
    php artisan migrate --force
fi

echo "Create the symbolic link 'php artisan storage:link'..."
php artisan storage:link

echo "*--------------------------------------------------------------[exec run script]"
source ${STI_SCRIPTS_PATH}/run

.s2i/enviroment

.s2i/environment
DOCUMENTROOT=/public
SHORT_OPEN_TAG=ON
APP_LOG=errorlog

DB_CONNECTION=
DB_HOST=mariadb
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=root@1234

※DB_CONNECTIONを空欄にしているのはとりあえずDBを使わないで設定確認してみたかったためです。
 ここにMySQLやMariaDBならmysqlと入れればphp artisan migrateが動作するはずです。

出来上がった.env

.env
sh-4.2$ more .env
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:AGGBg4IoDZqGPhlMdavU3jpWhRKKLl3w29VPIaYCizg=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=
DB_HOST=mariadb
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=root@1234

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

BuildのLog

Cloning "https://gitlab.com/imp555/laravel5.8-s2i.git" ...
    Commit: 27e3704fa70754bd6c90a428d9eecf16e8f9f280 (change s2i environment)
    Author: imp555
    Date:   Sun Mar 8 13:19:57 2020 +0900
Caching blobs under "/var/cache/blobs".
Getting image source signatures
Copying blob sha256:1d12b9a95cbaf32ab3bcb4a98f70e9e149e72000e86abc04c22ac495c8a70a15
Copying blob sha256:bb13d92caffa705f32b8a7f9f661e07ddede310c6ccfa78fb53a49539740e29b
Copying blob sha256:84e620d0abe585d05a7bed55144af0bc5efe083aed05eac1e88922034ddf1ed2
Copying blob sha256:01ace4f1c1164bbc4513b616c5cff62585fde1dc198b7469c5bc5bc5355941da
Copying blob sha256:455ea8ab06218495bbbcb14b750a0d644897b24f8c5dcf9e8698e27882583412
Copying config sha256:e0d2bc51569c2e3832781d6d8038cdb9af4322c0018f0072d76a402b8373a37f
Writing manifest to image destination
Storing signatures
Generating dockerfile with builder image image-registry.openshift-image-registry.svc:5000/openshift/php@sha256:a5aaaae5baf98cb674ac2352429e0450591b45d3674e44c516612a9ee67282d5
STEP 1: FROM image-registry.openshift-image-registry.svc:5000/openshift/php@sha256:a5aaaae5baf98cb674ac2352429e0450591b45d3674e44c516612a9ee67282d5
STEP 2: LABEL "io.openshift.build.commit.date"="Sun Mar 8 13:19:57 2020 +0900" "io.openshift.build.commit.id"="27e3704fa70754bd6c90a428d9eecf16e8f9f280" "io.openshift.build.commit.ref"="master" "io.openshift.build.commit.message"="change s2i environment" "io.openshift.build.source-location"="https://gitlab.com/imp555/laravel5.8-s2i.git" "io.openshift.build.source-context-dir"="/" "io.openshift.build.image"="image-registry.openshift-image-registry.svc:5000/openshift/php@sha256:a5aaaae5baf98cb674ac2352429e0450591b45d3674e44c516612a9ee67282d5" "io.openshift.build.commit.author"="imp555 <imp555@nethome.ne.jp>"
STEP 3: ENV DOCUMENTROOT="/public" SHORT_OPEN_TAG="ON" APP_LOG="errorlog" DB_CONNECTION="" DB_HOST="mariadb" DB_PORT="3306" DB_DATABASE="laravel" DB_USERNAME="root" DB_PASSWORD="root@1234" OPENSHIFT_BUILD_NAME="app-1" OPENSHIFT_BUILD_NAMESPACE="laravel" OPENSHIFT_BUILD_SOURCE="https://gitlab.com/imp555/laravel5.8-s2i.git" OPENSHIFT_BUILD_COMMIT="27e3704fa70754bd6c90a428d9eecf16e8f9f280"
STEP 4: USER root
STEP 5: COPY upload/scripts /tmp/scripts
STEP 6: COPY upload/src /tmp/src
STEP 7: RUN chown -R 1001:0 /tmp/scripts /tmp/src
STEP 8: USER 1001
STEP 9: RUN /tmp/scripts/assemble
*--------------------------------------------------------------------------[ENV]
APP_DATA=/opt/app-root/src
APP_LOG=errorlog
APP_ROOT=/opt/app-root
BASH=/bin/bash
BASHOPTS=cmdhist:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath
BASH_ALIASES=()
BASH_ARGC=()
BASH_ARGV=()
BASH_CMDS=()
BASH_LINENO=([0]="0")
BASH_SOURCE=([0]="/tmp/scripts/assemble")
BASH_VERSINFO=([0]="4" [1]="2" [2]="46" [3]="2" [4]="release" [5]="x86_64-redhat-linux-gnu")
BASH_VERSION='4.2.46(2)-release'
DB_CONNECTION=
DB_DATABASE=laravel
DB_HOST=mariadb
DB_PASSWORD=root@1234
DB_PORT=3306
DB_USERNAME=root
DESCRIPTION='PHP 7.2 available as container is a base platform for building and running various PHP 7.2 applications and frameworks. PHP is an HTML-embedded scripting language. PHP attempts to make it easy for developers to write dynamically generated web pages. PHP also offers built-in database integration for several commercial and non-commercial database management systems, so writing a database-enabled webpage with PHP is fairly simple. The most common use of PHP coding is probably as a replacement for CGI scripts.'
DIRSTACK=()
DOCUMENTROOT=/public
EUID=1001
GROUPS=()
HOME=/opt/app-root/src
HOSTNAME=ed010caaebd4
HOSTTYPE=x86_64
HTTPD_CONFIGURATION_PATH=/opt/app-root/etc/conf.d
HTTPD_DATA_ORIG_PATH=/opt/rh/httpd24/root/var/www
HTTPD_DATA_PATH=/var/www
HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d
HTTPD_MAIN_CONF_PATH=/etc/httpd/conf
HTTPD_VAR_PATH=/opt/rh/httpd24/root/var
HTTPD_VAR_RUN=/var/run/httpd
IFS=$' \t\n'
LD_LIBRARY_PATH=/opt/rh/rh-nodejs10/root/usr/lib64:/opt/rh/httpd24/root/usr/lib64:/opt/rh/rh-php72/root/usr/lib64
LIBRARY_PATH=/opt/rh/httpd24/root/usr/lib64
MACHTYPE=x86_64-redhat-linux-gnu
MANPATH=/opt/rh/rh-nodejs10/root/usr/share/man:/opt/rh/httpd24/root/usr/share/man:/opt/rh/rh-php72/root/usr/share/man:
NAME=php
NODEJS_SCL=rh-nodejs10
OPENSHIFT_BUILD_COMMIT=27e3704fa70754bd6c90a428d9eecf16e8f9f280
OPENSHIFT_BUILD_NAME=app-1
OPENSHIFT_BUILD_NAMESPACE=laravel
OPENSHIFT_BUILD_SOURCE=https://gitlab.com/imp555/laravel5.8-s2i.git
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/opt/rh/rh-nodejs10/root/usr/bin:/opt/rh/httpd24/root/usr/bin:/opt/rh/httpd24/root/usr/sbin:/opt/rh/rh-php72/root/usr/bin:/opt/rh/rh-php72/root/usr/sbin:/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/rh/rh-php72/root/usr/bin
PHP_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/php/
PHP_DEFAULT_INCLUDE_PATH=/opt/rh/rh-php72/root/usr/share/pear
PHP_HTTPD_CONF_FILE=rh-php72-php.conf
PHP_SYSCONF_PATH=/etc/opt/rh/rh-php72
PHP_VERSION=7.2
PHP_VER_SHORT=72
PIPESTATUS=([0]="0")
PKG_CONFIG_PATH=/opt/rh/httpd24/root/usr/lib64/pkgconfig
PLATFORM=el7
PPID=1991
PS4='+ '
PWD=/opt/app-root/src
PYTHONPATH=/opt/rh/rh-nodejs10/root/usr/lib/python2.7/site-packages
SCL_ENABLED=rh-php72
SHELL=/sbin/nologin
SHELLOPTS=braceexpand:errexit:hashall:interactive-comments
SHLVL=2
SHORT_OPEN_TAG=ON
STI_SCRIPTS_PATH=/usr/libexec/s2i
STI_SCRIPTS_URL=image:///usr/libexec/s2i
SUMMARY='Platform for building and running PHP 7.2 applications'
TERM=dumb
UID=1001
X_SCLS='rh-nodejs10 httpd24 rh-php72 '
_='*--------------------------------------------------------------------------[ENV]'
_i=3
_recursion=false
_scl_dir=/etc/scl/conf
_scl_prefix=/opt/rh
_scl_prefix_file=/etc/scl/conf/rh-nodejs10
_scl_prefixes=()
_scl_scriptlet_name=
_scl_scriptlet_path=/opt/rh/rh-nodejs10/enable
_scl_source_help=$'Usage: source scl_source <action> [<collection> ...]\n\nDon\'t use this script outside of SCL scriptlets!\n\nOptions:\n    -h, --help    display this help and exit'
_scls=()
arg=rh-nodejs10
container=oci
scl=httpd24
*---------------------------------------------------------[exec assemble script]
---> Installing application source...
Found 'composer.json', installing dependencies using composer.phar... 
Downloading https://getcomposer.org/installer, attempt 1/6
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  5  270k    5 16110    0     0  13550      0  0:00:20  0:00:01  0:00:19 13549100  270k  100  270k    0     0   156k      0  0:00:01  0:00:01 --:--:--  156k
All settings correct for using Composer
Downloading...

Composer (version 1.9.3) successfully installed to: /opt/app-root/src/composer.phar
Use it: php composer.phar

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 81 installs, 0 updates, 0 removals
  - Installing doctrine/inflector (1.3.1): Downloading (100%)
  - Installing doctrine/lexer (1.0.2): Downloading (100%)
  - Installing dragonmantank/cron-expression (v2.3.0): Downloading (100%)
  - Installing erusev/parsedown (1.7.4): Downloading (100%)
  - Installing symfony/polyfill-ctype (v1.14.0): Downloading (100%)
  - Installing phpoption/phpoption (1.7.2): Downloading (100%)
  - Installing vlucas/phpdotenv (v3.6.0): Downloading (100%)
  - Installing symfony/css-selector (v4.4.5): Downloading (100%)
  - Installing tijsverkoyen/css-to-inline-styles (2.2.2): Downloading (100%)
  - Installing symfony/polyfill-php72 (v1.14.0): Downloading (100%)
  - Installing symfony/polyfill-mbstring (v1.14.0): Downloading (100%)
  - Installing symfony/var-dumper (v4.4.5): Downloading (100%)
  - Installing symfony/routing (v4.4.5): Downloading (100%)
  - Installing symfony/process (v4.4.5): Downloading (100%)
  - Installing symfony/polyfill-php73 (v1.14.0): Downloading (100%)
  - Installing symfony/polyfill-intl-idn (v1.14.0): Downloading (100%)
  - Installing symfony/mime (v4.4.5): Downloading (100%)
  - Installing symfony/http-foundation (v4.4.5): Downloading (100%)
  - Installing symfony/event-dispatcher-contracts (v1.1.7): Downloading (100%)
  - Installing symfony/event-dispatcher (v4.4.5): Downloading (100%)
  - Installing psr/log (1.1.2): Downloading (100%)
  - Installing symfony/debug (v4.4.5): Downloading (100%)
  - Installing symfony/error-handler (v4.4.5): Downloading (100%)
  - Installing symfony/http-kernel (v4.4.5): Downloading (100%)
  - Installing symfony/finder (v4.4.5): Downloading (100%)
  - Installing psr/container (1.0.0): Downloading (100%)
  - Installing symfony/service-contracts (v1.1.8): Downloading (100%)
  - Installing symfony/console (v4.4.5): Downloading (100%)
  - Installing symfony/polyfill-iconv (v1.14.0): Downloading (100%)
  - Installing egulias/email-validator (2.1.17): Downloading (100%)
  - Installing swiftmailer/swiftmailer (v6.2.3): Downloading (100%)
  - Installing paragonie/random_compat (v9.99.99): Downloading (100%)
  - Installing ramsey/uuid (3.9.3): Downloading (100%)
  - Installing psr/simple-cache (1.0.1): Downloading (100%)
  - Installing opis/closure (3.5.1): Downloading (100%)
  - Installing symfony/translation-contracts (v1.1.7): Downloading (100%)
  - Installing symfony/translation (v4.4.5): Downloading (100%)
  - Installing nesbot/carbon (2.31.0): Downloading (100%)
  - Installing monolog/monolog (1.25.3): Downloading (100%)
  - Installing league/flysystem (1.0.46): Downloading (100%)
  - Installing laravel/framework (v5.8.37): Downloading (100%)
  - Installing fideloper/proxy (4.3.0): Downloading (100%)
  - Installing jakub-onderka/php-console-color (v0.2): Downloading (100%)
  - Installing nikic/php-parser (v4.3.0): Downloading (100%)
  - Installing jakub-onderka/php-console-highlighter (v0.4): Downloading (100%)
  - Installing dnoegel/php-xdg-base-dir (v0.1.1): Downloading (100%)
  - Installing psy/psysh (v0.9.12): Downloading (100%)
  - Installing laravel/tinker (v1.0.10): Downloading (100%)
  - Installing beyondcode/laravel-dump-server (1.3.0): Downloading (100%)
  - Installing fzaninotto/faker (v1.9.1): Downloading (100%)
  - Installing hamcrest/hamcrest-php (v2.0.0): Downloading (100%)
  - Installing mockery/mockery (1.3.1): Downloading (100%)
  - Installing filp/whoops (2.7.1): Downloading (100%)
  - Installing nunomaduro/collision (v3.0.1): Downloading (100%)
  - Installing webmozart/assert (1.7.0): Downloading (100%)
  - Installing phpdocumentor/reflection-common (2.0.0): Downloading (100%)
  - Installing phpdocumentor/type-resolver (1.0.1): Downloading (100%)
  - Installing phpdocumentor/reflection-docblock (4.3.4): Downloading (100%)
  - Installing phpunit/php-token-stream (3.1.1): Downloading (100%)
  - Installing sebastian/version (2.0.1): Downloading (100%)
  - Installing sebastian/resource-operations (2.0.1): Downloading (100%)
  - Installing sebastian/recursion-context (3.0.0): Downloading (100%)
  - Installing sebastian/object-reflector (1.1.1): Downloading (100%)
  - Installing sebastian/object-enumerator (3.0.3): Downloading (100%)
  - Installing sebastian/global-state (2.0.0): Downloading (100%)
  - Installing sebastian/exporter (3.1.2): Downloading (100%)
  - Installing sebastian/environment (4.2.3): Downloading (100%)
  - Installing sebastian/diff (3.0.2): Downloading (100%)
  - Installing sebastian/comparator (3.0.2): Downloading (100%)
  - Installing phpunit/php-timer (2.1.2): Downloading (100%)
  - Installing phpunit/php-text-template (1.2.1): Downloading (100%)
  - Installing phpunit/php-file-iterator (2.0.2): Downloading (100%)
  - Installing theseer/tokenizer (1.1.3): Downloading (100%)
  - Installing sebastian/code-unit-reverse-lookup (1.0.1): Downloading (100%)
  - Installing phpunit/php-code-coverage (6.1.4): Downloading (100%)
  - Installing doctrine/instantiator (1.3.0): Downloading (100%)
  - Installing phpspec/prophecy (v1.10.3): Downloading (100%)
  - Installing phar-io/version (2.0.1): Downloading (100%)
  - Installing phar-io/manifest (1.0.3): Downloading (100%)
  - Installing myclabs/deep-copy (1.9.5): Downloading (100%)
  - Installing phpunit/phpunit (7.5.20): Downloading (100%)
symfony/routing suggests installing doctrine/annotations (For using the annotation loader)
symfony/routing suggests installing symfony/config (For using the all-in-one router or any loader)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
symfony/routing suggests installing symfony/yaml (For using the YAML loader)
symfony/event-dispatcher-contracts suggests installing psr/event-dispatcher
symfony/event-dispatcher suggests installing symfony/dependency-injection
symfony/http-kernel suggests installing symfony/browser-kit
symfony/http-kernel suggests installing symfony/config
symfony/http-kernel suggests installing symfony/dependency-injection
symfony/service-contracts suggests installing symfony/service-implementation
symfony/console suggests installing symfony/lock
swiftmailer/swiftmailer suggests installing true/punycode (Needed to support internationalized email addresses, if ext-intl is not installed)
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
ramsey/uuid suggests installing ext-libsodium (Provides the PECL libsodium extension for use with the SodiumRandomGenerator)
ramsey/uuid suggests installing ext-uuid (Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator)
ramsey/uuid suggests installing moontoast/math (Provides support for converting UUID to 128-bit integer (in string form).)
ramsey/uuid suggests installing paragonie/random-lib (Provides RandomLib for use with the RandomLibAdapter)
ramsey/uuid suggests installing ramsey/uuid-console (A console application for generating UUIDs with ramsey/uuid)
ramsey/uuid suggests installing ramsey/uuid-doctrine (Allows the use of Ramsey\Uuid\Uuid as Doctrine field type.)
symfony/translation suggests installing symfony/config
symfony/translation suggests installing symfony/yaml
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing sentry/sentry (Allow sending log messages to a Sentry server)
league/flysystem suggests installing league/flysystem-aws-s3-v2 (Allows you to use S3 storage with AWS SDK v2)
league/flysystem suggests installing league/flysystem-aws-s3-v3 (Allows you to use S3 storage with AWS SDK v3)
league/flysystem suggests installing league/flysystem-azure (Allows you to use Windows Azure Blob storage)
league/flysystem suggests installing league/flysystem-cached-adapter (Flysystem adapter decorator for metadata caching)
league/flysystem suggests installing league/flysystem-eventable-filesystem (Allows you to use EventableFilesystem)
league/flysystem suggests installing league/flysystem-rackspace (Allows you to use Rackspace Cloud Files)
league/flysystem suggests installing league/flysystem-sftp (Allows you to use SFTP server storage via phpseclib)
league/flysystem suggests installing league/flysystem-webdav (Allows you to use WebDAV storage)
league/flysystem suggests installing league/flysystem-ziparchive (Allows you to use ZipArchive adapter)
league/flysystem suggests installing spatie/flysystem-dropbox (Allows you to use Dropbox storage)
league/flysystem suggests installing srmklive/flysystem-dropbox-v2 (Allows you to use Dropbox storage for PHP 5 applications)
laravel/framework suggests installing aws/aws-sdk-php (Required to use the SQS queue driver and SES mail driver (^3.0).)
laravel/framework suggests installing doctrine/dbal (Required to rename columns and drop SQLite columns (^2.6).)
laravel/framework suggests installing guzzlehttp/guzzle (Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (^6.0).)
laravel/framework suggests installing league/flysystem-aws-s3-v3 (Required to use the Flysystem S3 driver (^1.0).)
laravel/framework suggests installing league/flysystem-cached-adapter (Required to use the Flysystem cache (^1.0).)
laravel/framework suggests installing league/flysystem-rackspace (Required to use the Flysystem Rackspace driver (^1.0).)
laravel/framework suggests installing league/flysystem-sftp (Required to use the Flysystem SFTP driver (^1.0).)
laravel/framework suggests installing moontoast/math (Required to use ordered UUIDs (^1.1).)
laravel/framework suggests installing nexmo/client (Required to use the Nexmo transport (^1.0).)
laravel/framework suggests installing pda/pheanstalk (Required to use the beanstalk queue driver (^4.0).)
laravel/framework suggests installing predis/predis (Required to use the redis cache and queue drivers (^1.0).)
laravel/framework suggests installing pusher/pusher-php-server (Required to use the Pusher broadcast driver (^3.0).)
laravel/framework suggests installing symfony/dom-crawler (Required to use most of the crawler integration testing tools (^4.2).)
laravel/framework suggests installing symfony/psr-http-message-bridge (Required to use PSR-7 bridging features (^1.1).)
laravel/framework suggests installing wildbit/swiftmailer-postmark (Required to use Postmark mail driver (^3.0).)
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)
filp/whoops suggests installing whoops/soap (Formats errors as SOAP responses)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.6.0)
phpunit/phpunit suggests installing ext-xdebug (*)
phpunit/phpunit suggests installing phpunit/php-invoker (^2.0)
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: [32mbeyondcode/laravel-dump-server[39m
Discovered Package: [32mfideloper/proxy[39m
Discovered Package: [32mlaravel/tinker[39m
Discovered Package: [32mnesbot/carbon[39m
Discovered Package: [32mnunomaduro/collision[39m
[32mPackage manifest generated successfully.[39m
=> sourcing 20-copy-config.sh ...
---> 08:27:10     Processing additional arbitrary httpd configuration provided by s2i ...
=> sourcing 00-documentroot.conf ...
=> sourcing 50-mpm-tuning.conf ...
=> sourcing 40-ssl-certs.sh ...
*------------------------------------------------------------[setup laravel env]
Application key set successfully.
=> setup .env
*--------------------------------------------------------------[apache settings]
=> apache setting changed
*-----------------------------------------------------------------[php settings]
=> php setting changed
STEP 10: CMD /tmp/scripts/run
STEP 11: COMMIT temp.builder.openshift.io/laravel/app-1:7a6f4b76
Getting image source signatures
Copying blob sha256:35817540a17b5b90cb4426078d53813b16e70c75e1cce3db116d2fbbca7fbf10
Copying blob sha256:c7fbe90ae90e9c6452e5d809f069907907e6f32532565104921f600fb956306c
Copying blob sha256:74d760a83a4b8bcb3d01e7726e06c11469f0bb2ce4645474cb91a607c27bf482
Copying blob sha256:f1cc3f0b20053e48dc0f6505734d2f476e4fcd975df9791164bd749af9332401
Copying blob sha256:c19ff85c66e8be48cab01b2574aa562291be030145d9debce919e008bb2b3c59
Copying blob sha256:17ffd1334fe779ff8812d24204d108c2a5ff778bb32f1b404e67dd07410ed448
Copying config sha256:473b1a7a70049c998232e8917365a25a33037a5b4bfc5369a11a028b1bf2f6b4
Writing manifest to image destination
Storing signatures
473b1a7a70049c998232e8917365a25a33037a5b4bfc5369a11a028b1bf2f6b4
473b1a7a70049c998232e8917365a25a33037a5b4bfc5369a11a028b1bf2f6b4

Pushing image image-registry.openshift-image-registry.svc:5000/laravel/app:latest ...
Getting image source signatures
Copying blob sha256:17ffd1334fe779ff8812d24204d108c2a5ff778bb32f1b404e67dd07410ed448
Copying blob sha256:bb13d92caffa705f32b8a7f9f661e07ddede310c6ccfa78fb53a49539740e29b
Copying blob sha256:84e620d0abe585d05a7bed55144af0bc5efe083aed05eac1e88922034ddf1ed2
Copying blob sha256:455ea8ab06218495bbbcb14b750a0d644897b24f8c5dcf9e8698e27882583412
Copying blob sha256:1d12b9a95cbaf32ab3bcb4a98f70e9e149e72000e86abc04c22ac495c8a70a15
Copying blob sha256:01ace4f1c1164bbc4513b616c5cff62585fde1dc198b7469c5bc5bc5355941da
Copying config sha256:473b1a7a70049c998232e8917365a25a33037a5b4bfc5369a11a028b1bf2f6b4
Writing manifest to image destination
Storing signatures
Successfully pushed image-registry.openshift-image-registry.svc:5000/laravel/app@sha256:97647d0c4e5d0a7d554d10d266eac76bc4d412f516bca9e179e862c61f5161c0
Push successful

PodのLog

*--------------------------------------------------------------------------[ENV]
APP_DATA=/opt/app-root/src
APP_LOG=errorlog
APP_PORT=tcp://172.30.142.243:8080
APP_PORT_8080_TCP=tcp://172.30.142.243:8080
APP_PORT_8080_TCP_ADDR=172.30.142.243
APP_PORT_8080_TCP_PORT=8080
APP_PORT_8080_TCP_PROTO=tcp
APP_PORT_8443_TCP=tcp://172.30.142.243:8443
APP_PORT_8443_TCP_ADDR=172.30.142.243
APP_PORT_8443_TCP_PORT=8443
APP_PORT_8443_TCP_PROTO=tcp
APP_ROOT=/opt/app-root
APP_SERVICE_HOST=172.30.142.243
APP_SERVICE_PORT=8080
APP_SERVICE_PORT_8080_TCP=8080
APP_SERVICE_PORT_8443_TCP=8443
BASH=/bin/bash
BASHOPTS=cmdhist:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath
BASH_ALIASES=()
BASH_ARGC=()
BASH_ARGV=()
BASH_CMDS=()
BASH_LINENO=([0]="0")
BASH_SOURCE=([0]="/tmp/scripts/run")
BASH_VERSINFO=([0]="4" [1]="2" [2]="46" [3]="2" [4]="release" [5]="x86_64-redhat-linux-gnu")
BASH_VERSION='4.2.46(2)-release'
DB_CONNECTION=
DB_DATABASE=laravel
DB_HOST=mariadb
DB_PASSWORD=root@1234
DB_PORT=3306
DB_USERNAME=root
DESCRIPTION='PHP 7.2 available as container is a base platform for building and running various PHP 7.2 applications and frameworks. PHP is an HTML-embedded scripting language. PHP attempts to make it easy for developers to write dynamically generated web pages. PHP also offers built-in database integration for several commercial and non-commercial database management systems, so writing a database-enabled webpage with PHP is fairly simple. The most common use of PHP coding is probably as a replacement for CGI scripts.'
DIRSTACK=()
DOCUMENTROOT=/public
EUID=1000540000
GROUPS=()
HOME=/opt/app-root/src
HOSTNAME=app-6b84968989-sk8sl
HOSTTYPE=x86_64
HTTPD_CONFIGURATION_PATH=/opt/app-root/etc/conf.d
HTTPD_DATA_ORIG_PATH=/opt/rh/httpd24/root/var/www
HTTPD_DATA_PATH=/var/www
HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d
HTTPD_MAIN_CONF_PATH=/etc/httpd/conf
HTTPD_VAR_PATH=/opt/rh/httpd24/root/var
HTTPD_VAR_RUN=/var/run/httpd
IFS=$' \t\n'
KUBERNETES_PORT=tcp://172.30.0.1:443
KUBERNETES_PORT_443_TCP=tcp://172.30.0.1:443
KUBERNETES_PORT_443_TCP_ADDR=172.30.0.1
KUBERNETES_PORT_443_TCP_PORT=443
KUBERNETES_PORT_443_TCP_PROTO=tcp
KUBERNETES_SERVICE_HOST=172.30.0.1
KUBERNETES_SERVICE_PORT=443
KUBERNETES_SERVICE_PORT_HTTPS=443
LD_LIBRARY_PATH=/opt/rh/rh-nodejs10/root/usr/lib64:/opt/rh/httpd24/root/usr/lib64:/opt/rh/rh-php72/root/usr/lib64
LIBRARY_PATH=/opt/rh/httpd24/root/usr/lib64
MACHTYPE=x86_64-redhat-linux-gnu
MANPATH=/opt/rh/rh-nodejs10/root/usr/share/man:/opt/rh/httpd24/root/usr/share/man:/opt/rh/rh-php72/root/usr/share/man:
NAME=php
NODEJS_SCL=rh-nodejs10
OPENSHIFT_BUILD_COMMIT=27e3704fa70754bd6c90a428d9eecf16e8f9f280
OPENSHIFT_BUILD_NAME=app-1
OPENSHIFT_BUILD_NAMESPACE=laravel
OPENSHIFT_BUILD_SOURCE=https://gitlab.com/imp555/laravel5.8-s2i.git
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/opt/rh/rh-nodejs10/root/usr/bin:/opt/rh/httpd24/root/usr/bin:/opt/rh/httpd24/root/usr/sbin:/opt/rh/rh-php72/root/usr/bin:/opt/rh/rh-php72/root/usr/sbin:/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/rh/rh-php72/root/usr/bin
PHP_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/php/
PHP_DEFAULT_INCLUDE_PATH=/opt/rh/rh-php72/root/usr/share/pear
PHP_HTTPD_CONF_FILE=rh-php72-php.conf
PHP_SYSCONF_PATH=/etc/opt/rh/rh-php72
PHP_VERSION=7.2
PHP_VER_SHORT=72
PIPESTATUS=([0]="0")
PKG_CONFIG_PATH=/opt/rh/httpd24/root/usr/lib64/pkgconfig
PLATFORM=el7
PPID=0
PS4='+ '
PWD=/opt/app-root/src
PYTHONPATH=/opt/rh/rh-nodejs10/root/usr/lib/python2.7/site-packages
SCL_ENABLED=rh-php72
SHELL=/sbin/nologin
SHELLOPTS=braceexpand:errexit:hashall:interactive-comments
SHLVL=2
SHORT_OPEN_TAG=ON
STI_SCRIPTS_PATH=/usr/libexec/s2i
STI_SCRIPTS_URL=image:///usr/libexec/s2i
SUMMARY='Platform for building and running PHP 7.2 applications'
TERM=xterm
UID=1000540000
X_SCLS='rh-nodejs10 httpd24 rh-php72 '
_='*--------------------------------------------------------------------------[ENV]'
container=oci
*----------------------------------------------------------------[setup laravel]
Create the symbolic link 'php artisan storage:link'...
The [public/storage] directory has been linked.
*--------------------------------------------------------------[exec run script]
=> sourcing 20-copy-config.sh ...
---> 08:28:00     Processing additional arbitrary httpd configuration provided by s2i ...
=> sourcing 00-documentroot.conf ...
=> sourcing 50-mpm-tuning.conf ...
=> sourcing 40-ssl-certs.sh ...
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.128.0.52. Set the 'ServerName' directive globally to suppress this message
[Sun Mar 08 08:28:01.485046 2020] [ssl:warn] [pid 1] AH01909: 10.128.0.52:8443:0 server certificate does NOT include an ID which matches the server name
[Sun Mar 08 08:28:01.635652 2020] [ssl:warn] [pid 1] AH01909: 10.128.0.52:8443:0 server certificate does NOT include an ID which matches the server name
[Sun Mar 08 08:28:01.637703 2020] [http2:warn] [pid 1] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Sun Mar 08 08:28:01.640382 2020] [lbmethod_heartbeat:notice] [pid 1] AH02282: No slotmem from mod_heartmonitor
[Sun Mar 08 08:28:01.840513 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips configured -- resuming normal operations
[Sun Mar 08 08:28:01.840655 2020] [core:notice] [pid 1] AH00094: Command line: 'httpd -D FOREGROUND'
10.128.0.1 - - [08/Mar/2020:08:28:22 +0000] "GET / HTTP/1.1" 200 2360 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0"
10.128.0.1 - - [08/Mar/2020:08:28:23 +0000] "GET /favicon.ico HTTP/1.1" 200 - "-" "Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0"

実行結果

ちゃんとrootでlaravelのHomeページが表示されました!

2020-03-08.png

MariaDBなどDBもって場合はこちらが続きとなります。
openshift4.3でlaravel+MariaDBする

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0