0

Docker を使用してスレートをビルドしようとしましたが、ソースをコンパイルしても、修正された変更は影響を受けません。ソースパスには以下のファイルがあります。

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"]

docker-compose.yml

slate:
  build: .
  ports:
   - 4567:4567
  volumes:
   - ./source:/slate/source
   - ./build:/slate/build

メイクファイル

.PHONY: build
build:
  docker-compose build
up:
  docker-compose up
compile:
   docker-compose run slate bundle exec middleman build --clean

make compile の出力を試してみると、

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 build を実行すると

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が初めてです。

ありがとう。

4

1 に答える 1

0

これを試して:docker-compose up --build

于 2016-12-09T08:40:06.083 に答える