ci: align docker packaging path

This commit is contained in:
Kevin Yue committed 2026-05-09 20:10:24 +08:00
1 parent ebadab8f06
commit 18b788e664
4 files changed
+43 -54

No files matched your search

+31 -20
View File
@@ -23,6 +23,7 @@ A modern GlobalProtect VPN client for Linux, built on OpenConnect with full supp
- [Alpine Linux](#alpine-linux)
- [Gentoo](#gentoo)
- [NixOS](#nixos)
- [Official Docker Image](#official-docker-image)
- [Other Distributions](#other-distributions)
- [Building from Source](#building-from-source)
- [Frequently Asked Questions](#frequently-asked-questions)
@@ -197,26 +198,6 @@ sudo apk add --allow-untrusted globalprotect-openconnect-*.apk
The package uses Alpine's native musl build. Make sure the `community` repository is enabled so GUI dependencies such as `webkit2gtk-4.1`, `libsecret`, and `libayatana-appindicator` can be resolved. GUI-launched connections use polkit, and VPN tunnel creation requires `/dev/net/tun`.
#### Minimal CLI Docker Image
For a container that only needs `gpclient`, build the Alpine CLI image from source:
```bash
git clone https://github.com/yuezk/GlobalProtect-openconnect.git
cd GlobalProtect-openconnect
git submodule update --init --recursive
docker build -f packaging/docker/cli-alpine/Dockerfile -t gpclient-alpine .
```
Run it with access to the TUN device:
```bash
docker run --rm -it --cap-add=NET_ADMIN --device=/dev/net/tun gpclient-alpine \
connect <portal> --cookie-on-stdin
```
The image uses `BUILD_GUI_HELPER=0` and `INCLUDE_GUI=0`, so it does not build or install `gpgui-helper` or `gpgui`.
### Gentoo
Available via the `guru` and `lamdness` overlays:
@@ -282,6 +263,36 @@ If you want it managed as part of your NixOS system configuration, use the steps
sudo nixos-rebuild switch
```
### Official Docker Image
The official Docker image provides the CLI tools on Alpine Linux:
```bash
docker pull yuezk/globalprotect-openconnect:<version>
```
Release images are tagged as `vX.Y.Z`, `X.Y.Z`, and `latest`.
Run it with access to the TUN device:
```bash
docker run --rm -it --cap-add=NET_ADMIN --device=/dev/net/tun \
yuezk/globalprotect-openconnect:<version> \
connect <portal> --cookie-on-stdin
```
For browser authentication in a headless environment, pipe `gpauth` remote-browser output into `gpclient`:
```bash
docker run --rm -it --entrypoint gpauth yuezk/globalprotect-openconnect:<version> \
<portal> --browser remote 2>/dev/null \
| docker run --rm -i --cap-add=NET_ADMIN --device=/dev/net/tun \
yuezk/globalprotect-openconnect:<version> \
connect <portal> --cookie-on-stdin
```
The image includes `gpclient` and `gpauth` only. It does not include embedded webview authentication, `gpgui-helper`, or `gpgui`.
### Other Distributions
#### Manual Installation
+1 -1
View File
@@ -21,7 +21,7 @@ clap.workspace = true
env_logger.workspace = true
log.workspace = true
serde_json.workspace = true
tokio.workspace = true
tokio = { workspace = true, features = ["rt-multi-thread"] }
tempfile.workspace = true
compile-time.workspace = true
+10 -33
View File
@@ -15,7 +15,7 @@ use gpapi::{
error::PortalError,
gateway::{GatewayLogin, SessionExtensionAuth, gateway_login},
gp_params::{ClientOs, GpParams},
portal::{Prelogin, SamlPrelogin, StandardPrelogin, prelogin, retrieve_config},
portal::{Prelogin, StandardPrelogin, prelogin, retrieve_config},
process::{
auth_launcher::SamlAuthLauncher,
users::{get_non_root_user, get_user_by_name},
@@ -154,7 +154,6 @@ pub(crate) struct ConnectArgs {
#[arg(long, help = "Deprecated: Use the `--browser` option instead")]
default_browser: bool,
#[cfg(feature = "webview-auth")]
#[arg(
long,
help = "Use the specified browser to authenticate, e.g., `default`, `firefox`, `chrome`, `chromium`, `remote`.\nOr the path to the browser executable.\nUse 'remote' for headless servers.",
@@ -185,36 +184,6 @@ impl ConnectArgs {
Os::Mac => host_utils::get_macos_os_string(),
}
}
fn saml_auth_browser<'a>(&'a self, prelogin: &SamlPrelogin) -> anyhow::Result<Option<&'a str>> {
if prelogin.support_default_browser() {
return Ok(self.default_browser_saml_auth_browser());
}
self.embedded_saml_auth_browser()
}
#[cfg(feature = "webview-auth")]
fn default_browser_saml_auth_browser(&self) -> Option<&str> {
self.browser.as_deref()
}
#[cfg(not(feature = "webview-auth"))]
fn default_browser_saml_auth_browser(&self) -> Option<&str> {
None
}
#[cfg(feature = "webview-auth")]
fn embedded_saml_auth_browser(&self) -> anyhow::Result<Option<&str>> {
Ok(None)
}
#[cfg(not(feature = "webview-auth"))]
fn embedded_saml_auth_browser(&self) -> anyhow::Result<Option<&str>> {
bail!(
"The server does not support authentication via the default browser and the gpclient is not built with the `webview-auth` feature"
);
}
}
pub(crate) struct ConnectHandler<'a> {
@@ -569,7 +538,15 @@ impl<'a> ConnectHandler<'a> {
match prelogin {
Prelogin::Saml(prelogin) => {
let browser = self.args.saml_auth_browser(prelogin)?;
let browser = if prelogin.support_default_browser() {
self.args.browser.as_deref()
} else if !cfg!(feature = "webview-auth") {
bail!(
"The server does not support authentication via the default browser and the gpclient is not built with the `webview-auth` feature"
);
} else {
None
};
let os_version = self.args.os_version();
let verbose = self.shared_args.verbose.to_verbose_arg();
let user_agent = self.user_agent();
@@ -35,6 +35,7 @@ RUN make build \
LIBXML2_STATIC=1
RUN install -Dm755 target/release/gpclient /out/usr/bin/gpclient \
&& install -Dm755 target/release/gpauth /out/usr/bin/gpauth \
&& install -Dm755 packaging/files/usr/libexec/gpclient/vpnc-script /out/usr/libexec/gpclient/vpnc-script \
&& install -Dm755 packaging/files/usr/libexec/gpclient/hipreport.sh /out/usr/libexec/gpclient/hipreport.sh