Open ocodista opened 2 years ago
That’s the binary. You can just run it without unzipping it.
Hey @sudarshan-reddy thank you for the reply.
But unfortunately that didn't work either.
Code tried
docker run -it alpine
apk add --no-cache curl
curl -s -O https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64
chmod +x ./cloudflared-linux-amd64
./cloudflared-linux-amd64 -v
Could you try install libc6-compat
package in apk? I had no issue.
To anyone who got here.
curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o /usr/bin/cloudflared
It was missing the -L
flag.
To anyone who got here.
curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o /usr/bin/cloudflared
It was missing the
-L
flag.
Thanks I literally Just got here looking to deploy cloudflared on alpine linux.
To anyone who got here.
curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o /usr/bin/cloudflared
It was missing the
-L
flag.
any idea how I can run the cloudflare as a service on alpine linux? I want the tunnel to be running in the background upon boot.
Do that and execute cloudflared service install <key that i blurred on image>
, cloudflared will self install after it.
Just in case you may not know. Alpine has own cloudflared build on aports repository. But it is on testing branch (which is disabled by default on apk configuration), And the build is not by cloudflare. It is build from source by their build system.
Yeah I saw that, but i was on the testing branch... Would it make any difference?
To anyone who got here.
curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o /usr/bin/cloudflared
It was missing the
-L
flag.any idea how I can run the cloudflare as a service on alpine linux? I want the tunnel to be running in the background upon boot.
For anyone else who stumbles on this thread and follows that solution, cloudflared service install ...
installs a sysv service alpine doesn't know what to do with. You'll need to create a valid one if you want an alpine service. Here's a bare example:
#!/sbin/openrc-run
name=$(basename $(readlink -f $0))
cfgfile="/etc/$RC_SVCNAME/$RC_SVCNAME.conf"
command="/usr/bin/cloudflared"
command_args="--pidfile /var/run/$name.pid --autoupdate-freq 24h0m0s --config /etc/cloudflared/config.yml tunnel run"
command_user="root"
pidfile="/var/run/$name.pid"
stdout_log="/var/log/$name.log"
stderr_log="/var/log/$name.err"
command_background="yes"
Sticking it as /etc/init.d/cloudflared
and then rc-update add cloudflared default
should set it to work as expected.
Sticking it as
/etc/init.d/cloudflared
and thenrc-update add cloudflared default
should set it to work as expected.
Just in case someone is using Alpine Base image, rc-update
it a part of openrc
, so you need to install it manually by running:
apk add openrc
Cloudflared doesn't support multi tunnel with one config file, so I use softlinks to make services.
Here are my /etc/init.d/cloudflared
and /etc/conf.d/cloudflared
~ $ cat /etc/init.d/cloudflared
#!/sbin/openrc-run
name=${RC_SVCNAME}
command=/usr/bin/cloudflared
command_user=cloudflared:cloudflared # maybe should change
command_background="yes"
pidfile=/run/${RC_SVCNAME}.pid
# output_log="/var/log/${RC_SVCNAME}.log"
# error_log="/var/log/${RC_SVCNAME}.err"
depend() {
need net
after firewall
}
~ $ cat /etc/conf.d/cloudflared
command_args="tunnel --config /etc/cloudflared/${RC_SVCNAME##*.}.yml run"
When need to start a new tunnel service, just create two softlinks in both init.d
and conf.d
ln -s cloudflared cloudflared.example
and write config file at /etc/cloudflared/example.yml
.
Then it can be used as normal:
rc-service cloudflared.examplle start...
What's more, if you Create a remotely-managed tunnel (dashboard), you can change command_args into:
command_args="--pidfile /var/run/$name.pid --autoupdate-freq 24h0m0s tunnel run --token YOUR_TOKEN"
rc-update add cloudflared default One more command is needed
chmod +x /etc/init.d/cloudflared
curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o /usr/bin/cloudflared chmod +x /usr/bin/cloudflared usr/bin/cloudflared -v
and here is the complete installation.
curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o /usr/bin/cloudflared
chmod +x /usr/bin/cloudflared
usr/bin/cloudflared -v
I see that the binaries link are https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64
But what's the extension of this file?
How can I install it on alpine linux?
Does not work, any tips?