简体   繁体   English

从 dockerfile 创建自己的 Directus 镜像

[英]Create own Directus image from dockerfile

I downloaded Directus.io repo https://github.com/directus/directus and I want to create own image.我下载了 Directus.io repo https://github.com/directus/directus ,我想创建自己的图像。 How to do it using Dockerfile.如何使用 Dockerfile 做到这一点。

I tried to run script from repo docker https://github.com/directus/docker but i got error with message:我试图从 repo docker https://github.com/directus/docker运行脚本,但我收到错误消息:

Step 7/13 : COPY --chown=www-data:www-data ./directus/ /var/directus/
COPY failed: stat /var/lib/docker/tmp/docker-builder151402968/directus: no such file or directory

Here is a Dockerfile from our project which works just fine:这是我们项目中的一个Dockerfile ,它运行良好:

#
# Final image
#
FROM directus/directus:v8-apache

#
# Filesystem & permissions
#
COPY ./rootfs/ /

RUN chmod +x install.sh

#
# Port
#
EXPOSE 80

ENTRYPOINT ./install.sh

In the same directory we have rootfs dir with a content what we want to override from Directus, eg config files, some CSS etc...在同一个目录中,我们有rootfs目录,其中包含我们想要从 Directus 覆盖的内容,例如配置文件、一些 CSS 等...

/rootfs
  var
    directus
      public
        admin
          style.css
      src
      install.sh

Our install.sh script contains some stuff we need to run on startup.我们的install.sh脚本包含一些我们需要在启动时运行的东西。 The most important is to start Apache in the end:最重要的是最后启动Apache:

#!/bin/bash

# ...
# Our custom scripts 
# ...

apache2-foreground

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM