0

I have tried to build slate using Docker, but modified changes are not affected when i compile the source. in my source path I have below files.

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

Makefile

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

When I tried make compile output shows

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

and when I execute 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

and when I execute make up

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"

but when I go to browser(http://192.168.99.100:4567/- boot2docker ip) and check then it will shows original slate installation not my modified changes i have done to index.html.md file in source folder. The build folder in my path also have not been updated.

anyone can identify What i have done wrong here? I'm new to Docker.

Thanks.

UdayangaS
  • 1
  • 1
  • I think the server might be listening on the wrong interface. It seems to be listening on localhost (which is probably the loopback interface). I think it needs to listen on `0.0.0.0`. Can you change that in the config? – dnephin Jul 06 '16 at 14:47

1 Answers1

0

Try this: docker-compose up --build

FelixSFD
  • 6,052
  • 10
  • 43
  • 117