mirror of
https://github.com/hexboy/maven-mirror-tool.git
synced 2025-09-02 02:29:17 +00:00
add docker image usage instruction
This commit is contained in:
parent
86adff94cb
commit
848b1fa8f8
1 changed files with 39 additions and 10 deletions
49
README.md
49
README.md
|
@ -40,16 +40,16 @@ Follow these steps to set up the Maven repository mirroring and caching project:
|
||||||
|
|
||||||
1. Clone the repository:
|
1. Clone the repository:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/hexboy/maven-mirror-tool.git
|
git clone https://github.com/hexboy/maven-mirror-tool.git
|
||||||
cd maven-mirror-tool
|
cd maven-mirror-tool
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Install dependencies using Yarn:
|
2. Install dependencies using Yarn:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn install
|
yarn install
|
||||||
```
|
```
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|
||||||
|
@ -99,9 +99,9 @@ REPOSITORIES:
|
||||||
|
|
||||||
1. Start the Maven Repository Mirroring and Caching Tool:
|
1. Start the Maven Repository Mirroring and Caching Tool:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn start
|
yarn start
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Update your Gradle `build.gradle` files to use the local endpoint for Maven dependencies:
|
2. Update your Gradle `build.gradle` files to use the local endpoint for Maven dependencies:
|
||||||
|
|
||||||
|
@ -131,6 +131,35 @@ allprojects {
|
||||||
|
|
||||||
3. Run your Gradle builds as usual. The tool will intercept and resolve dependencies from the local endpoint, caching them if needed.
|
3. Run your Gradle builds as usual. The tool will intercept and resolve dependencies from the local endpoint, caching them if needed.
|
||||||
|
|
||||||
|
## Using the Docker Image
|
||||||
|
|
||||||
|
You can also run the Maven Repository Mirroring and Caching Tool using Docker. This can simplify deployment and ensure consistency across different environments.
|
||||||
|
|
||||||
|
To use the Docker image `hexboy2011/maven-mirror-tool:latest`, follow these steps:
|
||||||
|
|
||||||
|
1. Pull the Docker image:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker pull hexboy2011/maven-mirror-tool:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Run the Docker container, mapping port 8008 and binding the cache directory:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run -d \
|
||||||
|
-p 8008:8008 \
|
||||||
|
-v /your/custom/cache/dir:/home/node/app/local-cache \
|
||||||
|
hexboy2011/maven-mirror-tool:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
### In this example
|
||||||
|
|
||||||
|
- `-d`: Starts the container as a daemon, running it in the background.
|
||||||
|
|
||||||
|
- `-p 8008:8008`: Maps port 8008 on your host to port 8008 in the container.
|
||||||
|
|
||||||
|
- `-v /your/custom/cache/dir:/home/node/app/local-cache`: Binds the directory /your/custom/cache/dir on your host to /home/node/app/local-cache in the container, allowing the container to store cached artifacts locally.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Contributions are welcome! If you find any issues or would like to enhance the project, feel free to submit a pull request. Please follow the existing code style and provide clear commit messages.
|
Contributions are welcome! If you find any issues or would like to enhance the project, feel free to submit a pull request. Please follow the existing code style and provide clear commit messages.
|
||||||
|
|
Loading…
Add table
Reference in a new issue