简体   繁体   中英

How to set up openshift document in Docker container?

I'm so confuse that Openshift offer a way to set up document workstation locally with ascii_binder, that's ok, i can do it. but there is question, i want to set up openshift-docs in docker container, any way i have tried is useless.

Here is my idea:

I use asciibinder build in openshift-docs and generated _preview directory

After that, I made a image base on nginx and copy all files include _preview directory in to image's directory /usr/share/nginx/html .

After image generated, i use docker run to setup a container.

I entered in the container, changed the default.conf in /etc/nginx/conf.d , made the root become /usr/share/nginx/html/_preview/openshift-origin/latest .

After that, i restart container and entered it again.

Changed current directory to /usr/share/nginx/html , and use command asciibinder watch .

But when i view it in browser, there are many sources like js and css not found.

is my idea right? if it's wrong, so How can i set up openshift-docs in docker container?

my Dockerfile

FROM nginx:1.13.0
MAINTAINER heshengbang "trulyheshengbang@gmail.com"
ENV REFRESHED_AT 2018-04-06

RUN apt-get -qq update
RUN apt-get -qq install vim
RUN apt-get -qq install ruby ruby-dev build-essential nodejs git
RUN gem install ascii_binder


COPY . /usr/share/nginx/html/


CMD ["nginx", "-g", "daemon off;"]

Use this:

They even supply an example of deploying:

The README only shows s2i command line usage to build a docker image and run it, but to deploy in OpenShift you can run:

oc new-app openshift/asciibinder-018-centos7~https://github.com/openshift/openshift-docs.git
oc expose svc openshift-docs

You can deploy an asciibinder website on OpenShift with the following template: https://github.com/openshift/openshift-docs/blob/master/asciibinder-template.yml .

You can import this with

oc create -f https://raw.githubusercontent.com/openshift/openshift-docs/master/asciibinder-template.yml

Then deploy from the web console via
在此处输入图片说明

Make sure you have an assemble script similar to https://github.com/openshift/openshift-docs/blob/master/.s2i/bin/assemble in your project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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