0
我试图使用Docker构建slate,但修改后的更改不受影响,当我编译源代码时。在我的源代码路径中我有下面的文件。与Docker建立Slate的问题
Dockerfile
FROM debian:latest
MAINTAINER Fed
VOLUME /usr/src/app/source
EXPOSE 4567
RUN apt-get update && \
apt-get install -y ruby git ruby-dev make gcc zlib1g-dev nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN gem install bundler
RUN git clone https://github.com/tripit/slate.git /slate
WORKDIR "/slate"
RUN bundle install
CMD ["bundle", "exec", "middleman", "server", "--force-polling"]
泊坞窗,compose.yml
slate:
build: .
ports:
- 4567:4567
volumes:
- ./source:/slate/source
- ./build:/slate/build
的Makefile
.PHONY: build
build:
docker-compose build
up:
docker-compose up
compile:
docker-compose run slate bundle exec middleman build --clean
当我试图编译化妆输出显示
docker-compose run slate bundle exec middleman build --clean
create build/stylesheets/screen.css
create build/stylesheets/print.css
create build/images/navbar.png
create build/images/logo.png
create build/fonts/slate.svg
create build/fonts/slate.woff
create build/fonts/slate.woff2
create build/fonts/slate.ttf
create build/fonts/slate.eot
create build/javascripts/all.js
create build/javascripts/all_nosearch.js
create build/index.html
Project built successfully
,当我执行make构建
docker-compose build
Building slate
Step 1 : FROM debian:latest
---> 1b088884749b
Step 2 : MAINTAINER Fed
---> Using cache
---> f36ba5d1e018
Step 3 : VOLUME /usr/src/app/source
---> Using cache
---> d97292401c69
Step 4 : EXPOSE 4567
---> Using cache
---> 5ae0ecc71451
Step 5 : RUN apt-get update && apt-get install -y ruby git ruby-dev make gcc zlib1g-dev nodejs && apt-get clean && rm -rf /var/lib/apt/lists/*
---> Using cache
---> c83e099e40ee
Step 6 : RUN gem install bundler
---> Using cache
---> 4cc13ce89152
Step 7 : RUN git clone https://github.com/tripit/slate.git /slate
---> Using cache
---> 1ec325b7dc6b
Step 8 : WORKDIR "/slate"
---> Using cache
---> 8cc73cafc405
Step 9 : RUN bundle install
---> Using cache
---> 150ed469b196
Step 10 : CMD bundle exec middleman server --force-polling
---> Using cache
---> 9c2142617887
Successfully built 9c2142617887
,当我执行弥补
docker-compose up
Starting docs_slate_1
Attaching to docs_slate_1
slate_1 | == The Middleman is loading
slate_1 | == View your site at "http://localhost:4567", "http://127.0.0.1:4567"
slate_1 | == Inspect your site configuration at "http://localhost:4567/__middleman", "http://127.0.0.1:4567/__middleman"
但是当我去到浏览器(http://192.168.99.100:4567/- boot2docker IP)和校验,那么它会显示原来的石板安装不我对源文件夹中的index.html.md文件进行了修改。我的路径中的生成文件夹也没有更新。
任何人都可以识别我在这里做错了什么?我是新来的Docker。
谢谢。
我认为服务器可能正在监听错误的接口。它似乎在本地主机上侦听(这可能是回送接口)。我认为它需要倾听'0.0.0.0'。你可以在配置中改变它吗? – dnephin