0

我尝试使用 docker 创建 nanoc Markdown 文档页面部署。
Docker 容器创建成功。
在运行容器时,我收到 nanoc 配置错误并且容器停止。

我已经提到了实施的步骤。

遵循的步骤
步骤 1
Docker 文件

FROM ruby:latest

# Create app directory

WORKDIR /usr/src/app

COPY Gemfile .

# Copy the files
COPY . ./docs

RUN bundler install
RUN apt update

# Start the development/staging server
EXPOSE 3000
CMD ["bundler","exec","nanoc","view" ]

第2步

docker build -t nanoc:latest .

第 3 步

docker run -p 0.0.0.0:3000:3000 --name nanoc-latest -t -d nanoc:latest

Docker 日志容器 ID

在此处输入图像描述

4

1 回答 1

0

Docker file update:

FROM ruby:2.3
RUN mkdir -p /user/src/app
COPY . /usr/src/app
WORKDIR /usr/src/app/docs

RUN bundle install
RUN bundle exec nanoc
EXPOSE 3000
CMD bundle exec nanoc view

This configuration will sole the above error.

于 2020-02-20T13:15:00.257 回答