Skip to content

Commit

Permalink
Docker: Don't add the syntax file in the container.
Browse files Browse the repository at this point in the history
Use host volumes to bind the plug-in directory as /var/php. This allows
us to change the syntax file without rebuilding the container.
  • Loading branch information
StanAngeloff committed Jul 10, 2014
1 parent 4550a75 commit 973e6b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ RUN apt-get -y install \
php5-sqlite \
;

ADD . /build
ADD scripts/ /build

WORKDIR /build

ENTRYPOINT ["/usr/bin/php"]
CMD ["update-vim-syntax.php"]
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ The project comes with a Dockerfile which can be used to rebuild the syntax file

```bash
docker build -t stanangeloff/php.vim .
docker run -i -t stanangeloff/php.vim scripts/update-vim-syntax.php | sed 's/\x0D$//' > syntax/php.vim
docker run --rm -i -v "$PWD":/var/php -t stanangeloff/php.vim > /tmp/php.vim && cat /tmp/php.vim | sed 's/\x0D$//' > syntax/php.vim
docker rmi stanangeloff/php.vim
```
2 changes: 1 addition & 1 deletion scripts/update-vim-syntax.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@

# Read the existing syntax file with block markers in it.
#
$template = file_get_contents(__DIR__ . '/../syntax/php.vim');
$template = file_get_contents('/var/php/syntax/php.vim');

# Clean up any previously defined blocks.
$template = preg_replace(
Expand Down

0 comments on commit 973e6b1

Please sign in to comment.