Update README.md
Browse files
README.md
CHANGED
|
@@ -1,118 +1,9 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
> Cannot guarantee that the [GOST](https://github.com/ginuerzh/gost) and WARP client contained in the image are the latest versions. If necessary, please [build your own image](#build).
|
| 11 |
-
|
| 12 |
-
## Usage
|
| 13 |
-
|
| 14 |
-
### Start the container
|
| 15 |
-
|
| 16 |
-
To run the WARP client in Docker, just write the following content to `docker-compose.yml` and run `docker-compose up -d`.
|
| 17 |
-
|
| 18 |
-
```yaml
|
| 19 |
-
version: "3"
|
| 20 |
-
|
| 21 |
-
services:
|
| 22 |
-
warp:
|
| 23 |
-
image: caomingjun/warp
|
| 24 |
-
container_name: warp
|
| 25 |
-
restart: always
|
| 26 |
-
ports:
|
| 27 |
-
- "1080:1080"
|
| 28 |
-
environment:
|
| 29 |
-
- WARP_SLEEP=2
|
| 30 |
-
# - WARP_LICENSE_KEY= # optional
|
| 31 |
-
cap_add:
|
| 32 |
-
# Docker already have them, these are for podman users
|
| 33 |
-
- MKNOD
|
| 34 |
-
- AUDIT_WRITE
|
| 35 |
-
# additional required cap for warp, both for podman and docker
|
| 36 |
-
- NET_ADMIN
|
| 37 |
-
sysctls:
|
| 38 |
-
- net.ipv6.conf.all.disable_ipv6=0
|
| 39 |
-
- net.ipv4.conf.all.src_valid_mark=1
|
| 40 |
-
volumes:
|
| 41 |
-
- ./data:/var/lib/cloudflare-warp
|
| 42 |
-
```
|
| 43 |
-
|
| 44 |
-
Try it out to see if it works:
|
| 45 |
-
|
| 46 |
-
```bash
|
| 47 |
-
curl --socks5-hostname 127.0.0.1:1080 https://cloudflare.com/cdn-cgi/trace
|
| 48 |
-
```
|
| 49 |
-
|
| 50 |
-
If the output contains `warp=on` or `warp=plus`, the container is working properly. If the output contains `warp=off`, it means that the container failed to connect to the WARP service.
|
| 51 |
-
|
| 52 |
-
### Configuration
|
| 53 |
-
|
| 54 |
-
You can configure the container through the following environment variables:
|
| 55 |
-
|
| 56 |
-
- `WARP_SLEEP`: The time to wait for the WARP daemon to start, in seconds. The default is 2 seconds. If the time is too short, it may cause the WARP daemon to not start before using the proxy, resulting in the proxy not working properly. If the time is too long, it may cause the container to take too long to start. If your server has poor performance, you can increase this value appropriately.
|
| 57 |
-
- `WARP_LICENSE_KEY`: The license key of the WARP client, which is optional. If you have subscribed to WARP+ service, you can fill in the key in this environment variable. If you have not subscribed to WARP+ service, you can ignore this environment variable.
|
| 58 |
-
- `GOST_ARGS`: The arguments passed to GOST. The default is `-L :1080`, which means to listen on port 1080 in the container at the same time through HTTP and SOCKS5 protocols. If you want to have UDP support or use advanced features provided by other protocols, you can modify this parameter. For more information, refer to [GOST documentation](https://v2.gost.run/en/). If you modify the port number, you may also need to modify the port mapping in the `docker-compose.yml`.
|
| 59 |
-
- `REGISTER_WHEN_MDM_EXISTS`: If set, will register consumer account (WARP or WARP+, in contrast to Zero Trust) even when `mdm.xml` exists. You usually don't need this, as `mdm.xml` are usually used for Zero Trust. However, some users may want to adjust advanced settings in `mdm.xml` while still using consumer account.
|
| 60 |
-
- `BETA_FIX_HOST_CONNECTIVITY`: If set, will add checks for host connectivity into healthchecks and automatically fix it if necessary. See [host connectivity issue](docs/host-connectivity.md) for more information.
|
| 61 |
-
|
| 62 |
-
Data persistence: Use the host volume `./data` to persist the data of the WARP client. You can change the location of this directory or use other types of volumes. If you modify the `WARP_LICENSE_KEY`, please delete the `./data` directory so that the client can detect and register again.
|
| 63 |
-
|
| 64 |
-
For advanced usage or configurations, see [documentation](docs/README.md).
|
| 65 |
-
|
| 66 |
-
### Use other versions
|
| 67 |
-
|
| 68 |
-
The tag of docker image is in the format of `{WARP_VERSION}-{GOST_VERSION}`, for example, `2023.10.120-2.11.5` means that the WARP client version is `2023.10.120` and the GOST version is `2.11.5`. If you want to use other versions, you can specify the tag in the `docker-compose.yml`.
|
| 69 |
-
|
| 70 |
-
You can also use the `latest` tag to use the latest version of the image.
|
| 71 |
-
|
| 72 |
-
> [!NOTE]
|
| 73 |
-
> You can access the image built by a certain commit by using the tag `{WARP_VERSION}-{GOST_VERSION}-{COMMIT_SHA}`. Not all commits have images built.
|
| 74 |
-
|
| 75 |
-
> [!NOTE]
|
| 76 |
-
> Not all version combinations are available. Do check [the list of tags in Docker Hub](https://hub.docker.com/r/caomingjun/warp/tags) before you use one. If the version you want is not available, you can [build your own image](#build).
|
| 77 |
-
|
| 78 |
-
## Build
|
| 79 |
-
|
| 80 |
-
You can use Github Actions to build the image yourself.
|
| 81 |
-
|
| 82 |
-
1. Fork this repository.
|
| 83 |
-
2. Create necessary variables and secrets in the repository settings:
|
| 84 |
-
1. variable `REGISTRY`: for example, `docker.io` (Docker Hub)
|
| 85 |
-
2. variable `IMAGE_NAME`: for example, `caomingjun/warp`
|
| 86 |
-
3. variable `DOCKER_USERNAME`: for example, `caomingjun`
|
| 87 |
-
4. secret `DOCKER_PASSWORD`: generate a token in Docker Hub and fill in the token
|
| 88 |
-
3. Manually trigger the workflow `Build and push image` in the Actions tab.
|
| 89 |
-
|
| 90 |
-
This will build the image with the latest version of WARP client and GOST and push it to the specified registry. You can also specify the version of GOST by giving input to the workflow. Building image with custom WARP client version is not supported yet.
|
| 91 |
-
|
| 92 |
-
If you want to build the image locally, you can use [`.github/workflows/build-publish.yml`](.github/workflows/build-publish.yml) as a reference.
|
| 93 |
-
|
| 94 |
-
## Common problems
|
| 95 |
-
|
| 96 |
-
### Proxying UDP or even ICMP traffic
|
| 97 |
-
|
| 98 |
-
The default `GOST_ARGS` is `-L :1080`, which provides HTTP and SOCKS5 proxy. If you want to proxy UDP or even ICMP traffic, you need to change the `GOST_ARGS`. Read the [GOST documentation](https://v2.gost.run/en/) for more information. If you modify the port number, you may also need to modify the port mapping in the `docker-compose.yml`.
|
| 99 |
-
|
| 100 |
-
### How to connect from another container
|
| 101 |
-
|
| 102 |
-
You may want to use the proxy from another container and find that you cannot connect to `127.0.0.1:1080` in that container. This is because the `docker-compose.yml` only maps the port to the host, not to other containers. To solve this problem, you can use the service name as the hostname, for example, `warp:1080`. You also need to put the two containers in the same docker network.
|
| 103 |
-
|
| 104 |
-
### Container runs well but cannot connect from host
|
| 105 |
-
|
| 106 |
-
This issue often arises when using Zero Trust. You may find that you can run `curl --socks5-hostname 127.0.0.1:1080 https://cloudflare.com/cdn-cgi/trace` inside the container, but cannot run this command outside the container (from host or another container). This is because Cloudflare WARP client is grabbing the traffic. See [host connectivity issue](docs/host-connectivity.md) for solutions.
|
| 107 |
-
|
| 108 |
-
### How to enable MASQUE / use with Zero Trust / set up WARP Connector / change health check parameters
|
| 109 |
-
|
| 110 |
-
See [documentation](docs/README.md).
|
| 111 |
-
|
| 112 |
-
### Permission issue when using Podman
|
| 113 |
-
|
| 114 |
-
See [documentation](docs/podman.md) for explaination and solution.
|
| 115 |
-
|
| 116 |
-
## Further reading
|
| 117 |
-
|
| 118 |
-
For how it works, read my [blog post](https://blog.caomingjun.com/run-cloudflare-warp-in-docker/en/#How-it-works).
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Jkgfcd
|
| 3 |
+
emoji: 🏃
|
| 4 |
+
colorFrom: pink
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: false
|
| 8 |
+
app_port: 1080
|
| 9 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|