Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
NITEMAN committed Jun 4, 2020
1 parent 520d7ad commit be1d713
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
ARG REPOSITORY=https://github.com/gordalina/cachetool.git
ARG REF=5.0.0
ARG TARGET_DIR=/opt/cachetool

FROM composer:latest AS builder

ARG REPOSITORY
ARG REF
ARG TARGET_DIR

WORKDIR ${TARGET_DIR}

RUN cd ${TARGET_DIR} \
&& git clone ${REPOSITORY} . \
&& git checkout ${REF} \
&& composer install --no-dev --optimize-autoloader


FROM php:7.4-cli-buster

MAINTAINER Sbit.io <soporte@sbit.io>

ARG TARGET_DIR

WORKDIR ${TARGET_DIR}

ENV PATH=$PATH:$TARGET_DIR/bin

COPY --from=builder ${TARGET_DIR} ${TARGET_DIR}

#Not using entry ENTRYPOINT for backwards compatibility
CMD [ "cachetool", "help" ]
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
# docker-cachetool
# docker-cachetool
[![DockerHub Badge](http://dockeri.co/image/sbitio/cachetool)](https://hub.docker.com/r/sbitio/cachetool/)

A simple docker helper for running [gordalina's cachetool](https://github.com/gordalina/cachetool)

Invoking without command pints cachetool's help:
```bash
docker run --rm sbitio/cachetool
```

## Using
The most common use will be clearing caches.

Example Using web adapter:
```bash
docker run --rm -v <your-local-webserber-path>:<your-local-webserber-path> -w <your-local-webserber-path> sbitio/cachetool cachetool -v --web --web-url=<your-reachable-url> <your-cachetool-cmd-with-args>
```
Note: You can use docker's `--add-host` to leaverage nameserver resolution


## Extending

You can build containers using a fork:
```bash
docker build . --build-arg REPOSITORY=https://github.com/gordalina/cachetool REF=5.0.0 -t cachetool:<your-custom-tag>
```

## Testing code changes
Just mount the new code at `WORKDIR`:
```bash
docker run --rm -v <your-changed-code>:/opt/cachetool sbitio:cachetool <your-cachetool-cmg-with-args>
```

0 comments on commit be1d713

Please sign in to comment.