使用替代容器图像进行OPENSHIFT



我当前有一个旧应用程序,我正在尝试迁移到openshift。

但是,PHP 5.4在OpenShift 3.5中的默认容器映像没有可用。这是我的buildConfig文件的一部分。

    ...
    source:
    type: Git
    git:
      uri: 'https://xxx.git'
      ref: master
    secrets: null
  strategy:
    type: Source
    sourceStrategy:
      from:
        kind: ImageStreamTag
        namespace: openshift
        name: 'php:5.5'
        ...

到目前为止,一切都按预期工作。但是,在"源表面"部分中,如果我将名称更改为:"名称:'php:5.4'"它失败了。

是否有可能获得PHP 5.4环境的方法?

这个URL似乎有一个PHP 5.4墨盒:https://github.com/openshift-cartridges/origin-community-cartridges/tree/master/openshift-origin-cartridge-php-5.4

我将如何将其集成到我的OpenShift环境中?

我当前在测试机上运行OpenShift容器平台3.5。

谢谢。

Graham的评论中提到的软件收集库没有为容器提供具有PHP 5.4的容器,但是没有什么可以阻止您创建自己的图像并将其部署到OpenShift环境中。

创建安装PHP 5.4的图像,示例Dockerfile:

FROM centos:7
RUN yum install -y php-common php-cli ftp://rpmfind.net/linux/centos/7.3.1611/os/x86_64/Packages/php-5.4.16-42.el7.x86_64.rpm
CMD ["php", "-v"]

运行以下命令以构建图像并将其推到DockerHub docker build -t docker.io/your-username/php:5.4 . docker push docker.io/your-username/php:5.4

然后,您可以使用此图像创建成像级数,或在Docker Hub上直接在您的DeploymentConfig中的图像中引用containers:["image"]

最新更新