Skip to content

Commit 2ee6ac7

Browse files
committed
Let users use cached Docker images
1 parent 50cb1ca commit 2ee6ac7

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM bash AS build
2+
3+
COPY c5 /tmp/
4+
COPY c5.bat /tmp/
5+
COPY composerpkg /tmp/
6+
COPY composerpkg.bat /tmp/
7+
8+
RUN \
9+
chmod 0755 /tmp/c5 /tmp/composerpkg && \
10+
chmod 0555 /tmp/c5.bat /tmp/composerpkg.bat
11+
12+
FROM scratch
13+
14+
COPY --from=build /tmp/c5 /usr/bin/
15+
COPY --from=build /tmp/composerpkg /usr/bin/
16+
COPY --from=build /tmp/c5.bat /usr/bin/
17+
COPY --from=build /tmp/composerpkg.bat /usr/bin/

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,20 @@ That leads to having to having two running copies of the same library (one in th
8585

8686
To avoid these problems, you can run the `composerpkg` command included in this repository (for Windows users, you'll also need the `composerpkg.bat` file - to be saved in the same directory as the `composerpkg` file).
8787
`composerpkg` accepts the same arguments accepted by the plain `composer` command, but when you install/update the dependencies, you won't have duplicated stuff in your vendor directory.
88+
89+
90+
## Using the scripts in Docker images
91+
92+
You can download the scripts on the fly, like this:
93+
94+
```Dockerfile
95+
ADD https://raw.githubusercontent.com/concrete5/cli/master/c5 /usr/bin/
96+
97+
RUN chmod +x /usr/bin/c5
98+
```
99+
100+
You can also copy them from a Docker image, so that your build process doesn't have to download the scripts every time you need them:
101+
102+
```Dockerfile
103+
COPY --from=concrete5/cli /usr/bin/c5 /usr/bin/
104+
```

0 commit comments

Comments
 (0)