我正在使用自定义 Source-to-image 项目来构建 drupal 图像,以在 OpenShift 上运行。
从 cli 在本地运行时,s2i 项目运行良好。
我尝试使用https://docs.openshift.com/container-platform/3.4/dev_guide/managing_images.html#writing-image-streams-for-s2i-builders中的说明在 OpenShift 中进行设置。
S2i 项目
Drupal s2i 项目位于https://github.com/hughestech/s2i-shepherd-drupal
图像流
我的山药文件看起来像:
apiVersion: v1
kind: ImageStream
metadata:
name: drupal
annotations:
openshift.io/display-name: Drupal
spec:
tags:
- name: '2.0'
annotations:
openshift.io/display-name: Drupal Builder
description: >-
Build and run Drupal applications on CentOS 7.
iconClass: icon-php
sampleRepo: 'https://github.com/hughestech/open_social.git'
tags: 'builder,php, drupal'
version: '1.0'
from:
kind: DockerImage
name: '172.30.1.121:5000/test/s2i-shepherd-drupal:latest'
但是,当我运行它时(通过 OpenShift Web 控制台 > 目录 > PHP,我收到以下错误:
cp: cannot create regular file '././phpunit.xml.dist': Permission denied
cp: cannot create regular file '././social.info.yml': Permission denied
cp: cannot create regular file '././social.install': Permission denied
cp: cannot create regular file '././social.profile': Permission denied
cp: cannot create regular file '././.gitignore': Permission denied
cp: cannot create regular file '././.travis.yml': Permission denied
cp: cannot create regular file '././README.md': Permission denied
cp: cannot create regular file '././build-social.make': Permission denied
cp: cannot create regular file '././composer.json': Permission denied
cp: cannot create regular file '././drupal-org-core.make': Permission denied
cp: cannot create regular file '././drupal-org.make': Permission denied
cp: cannot create directory '././.git': Permission denied
cp: cannot create directory '././config': Permission denied
cp: cannot create directory '././libraries': Permission denied
cp: cannot create directory '././modules': Permission denied
cp: cannot create directory '././themes': Permission denied
cp: cannot create directory '././src': Permission denied
cp: cannot create directory '././tests': Permission denied
显然我需要授予权限 - 但是如何以及在哪里?这是我需要在 OpenShift 中做的事情吗?源被拉入的目录是否存在于 s2i 项目中,或者它是在 s2i 进程在 OpenShift 中运行时创建的?
构建 pod 错误
/apache2-foreground: 11: [: /var/www/html: unexpected operator
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.128.1.64. Set the 'ServerName' directive globally to suppress this message
[Tue Sep 12 13:07:05.474838 2017] [core:emerg] [pid 1] (13)Permission denied: AH00023: Couldn't create the rewrite-map mutex (file /var/lock/apache2/rewrite-map.1)
AH00016: Configuration Failed