Skip to content

Commit

Permalink
Merge pull request #140 from guilh22/master
Browse files Browse the repository at this point in the history
Adding documentation for CAP_ADD in captain definition and in Service…
  • Loading branch information
githubsaturn authored Aug 4, 2024
2 parents 3ddf18f + e4d585a commit 034cfd4
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/docker-compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,39 @@ volumes:
db-data: {}
```

## Service with CAP_ADD Flag

If you are working on a container like OpenVPN, they often require special cap_add docker flag. You can add them like this:

```yaml
captainVersion: 4
services:
openvpn:
caproverExtra:
containerHttpPort: 943
image: linuxserver/openvpn-as:2.9.0-5c5bd120-Ubuntu18-ls124
environment:
PUID: 1000
PGID: 1000
TZ: UTC
INTERFACE: ""
volumes:
- openvpn:/config
ports:
- 9443:9443
- 1194:1194
cap_add:
- NET_ADMIN
caproverOneClickApp:
displayName: OpenVPN Access Server
isOfficial: false
description: Full featured secure network tunneling VPN software.
documentation: https://openvpn.net/index.php/access-server/overview.html
instructions:
start: Just a openvpn Docker Compose with cap_add.
end: Docker Compose is deployed.
```


## Alternative Approach

Expand All @@ -206,3 +239,4 @@ networks:
```

Now instead of potential port mapping that you might have, like `8080:80`, you can just create a CapRover "Nginx Reverse Proxy" app and use your container name as the upstream proxy, like `http://web-app` and done!

12 changes: 12 additions & 0 deletions docs/service-update-override.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ TaskTemplate:
Command:
- ./mycommand.sh
Hostname: my.domain.com
CapabilityAdd:
- CAP_NET_ADMIN
DNSConfig:
Nameservers:
- 8.8.8.8
Expand Down Expand Up @@ -114,6 +116,16 @@ TaskTemplate:
Command: "./mycommand.sh"
```
If your container need some CAP_ADD added to the docker service, you can go as follow:
```yaml
TaskTemplate:
ContainerSpec:
CapabilityAdd:
- CAP_SYS_ADMIN
- CAP_NET_ADMIN
```
## Revert to Default
Expand Down

0 comments on commit 034cfd4

Please sign in to comment.