Skip to content

Commit 973e6b1

Browse files
committed
Docker: Don't add the syntax file in the container.
Use host volumes to bind the plug-in directory as /var/php. This allows us to change the syntax file without rebuilding the container.
1 parent 4550a75 commit 973e6b1

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ RUN apt-get -y install \
2020
php5-sqlite \
2121
;
2222

23-
ADD . /build
23+
ADD scripts/ /build
2424

2525
WORKDIR /build
2626

2727
ENTRYPOINT ["/usr/bin/php"]
28+
CMD ["update-vim-syntax.php"]

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ The project comes with a Dockerfile which can be used to rebuild the syntax file
2323

2424
```bash
2525
docker build -t stanangeloff/php.vim .
26-
docker run -i -t stanangeloff/php.vim scripts/update-vim-syntax.php | sed 's/\x0D$//' > syntax/php.vim
26+
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
27+
docker rmi stanangeloff/php.vim
2728
```

scripts/update-vim-syntax.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156

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

161161
# Clean up any previously defined blocks.
162162
$template = preg_replace(

0 commit comments

Comments
 (0)