Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpine Linux support #336

Closed
DaanSelen opened this issue Aug 23, 2024 · 22 comments
Closed

Alpine Linux support #336

DaanSelen opened this issue Aug 23, 2024 · 22 comments
Labels
enhancement New feature or request

Comments

@DaanSelen
Copy link
Collaborator

For the purpose of the Docker container and in general compatability it would be cool if there was Alpine Linux support.

Relevant: #334

@DaanSelen DaanSelen added the enhancement New feature or request label Aug 23, 2024
@DaanSelen
Copy link
Collaborator Author

@NOXCIS Perhaps you can support Donald in this.

@NOXCIS
Copy link
Contributor

NOXCIS commented Aug 23, 2024

@DaanSelen @donaldzou the install script is the only thing stopping alpine support, i think. also a bit of the gunicorn venv if i remember correctly.

@donaldzou
Copy link
Owner

@DaanSelen @donaldzou the install script is the only thing stopping alpine support, i think. also a bit of the gunicorn venv if i remember correctly.

Yes I'm currently testing on that

@donaldzou
Copy link
Owner

Hi all, please view this install script on Alpine linux. We might need to change some commands for Docker but this works on the standard Alpine Linux ISO:

Note

On line 3, please replace it with the fastest repo for you :)

setup-interfaces -a ; \
rc-service networking --quiet start ; \
printf "https://mirrors.aliyun.com/alpine/latest-stable/main\nhttps://mirrors.aliyun.com/alpine/latest-stable/community" > /etc/apk/repositories ; \
apk update ; \
apk add wireguard-tools python3 python3-dev git iptables net-tools gcc musl-dev linux-headers sudo ; \
git clone -b v4.0-alpine-linux https://github.com/donaldzou/WGDashboard.git ; \
cd ./WGDashboard/src ; \
chmod +x ./wgd.sh ; \
./wgd.sh install

@donaldzou
Copy link
Owner

If this works I'll merge the v4.0-alpine-linux branch into main :)

@NOXCIS
Copy link
Contributor

NOXCIS commented Aug 24, 2024

@donaldzou
2024-08-24 04:27:19 Starting the WireGuard Dashboard Docker container.
2024-08-24 04:27:19 Looking for remains of previous instances...
2024-08-24 04:27:19 No remains found, continuing.
2024-08-24 04:27:19 ------------------------------------------------------------
2024-08-24 04:27:19 [WGDashboard] Starting to install WGDashboard
2024-08-24 04:27:19 [WGDashboard] Creating ./log folder
2024-08-24 04:27:19 [WGDashboard] OS: alpine
2024-08-24 04:27:19 [WGDashboard] ✔ Python is installed
2024-08-24 04:27:21 [WGDashboard] ✔ Python Virtual Environment is installed
2024-08-24 04:27:23 [WGDashboard] ✔ Python Package Manager (PIP) is installed
2024-08-24 04:27:23 [WGDashboard] Creating ./db folder
2024-08-24 04:27:23 [WGDashboard] Creating Python Virtual Environment under ./venv
2024-08-24 04:27:28 [WGDashboard] Upgrading Python Package Manage (PIP)
2024-08-24 04:27:19 /opt/wireguarddashboard/src/wgd.sh: line 239: sudo: command not found
2024-08-24 04:27:30 [WGDashboard] Installing latest Python dependencies
2024-08-24 04:27:33 [WGDashboard] WGDashboard installed successfully!
2024-08-24 04:27:33 [WGDashboard] Enter ./wgd.sh start to start the dashboard
2024-08-24 04:27:33 ------------------------------------------------------------
2024-08-24 04:27:33 ------------------------------------------------------------
2024-08-24 04:27:33 [WGDashboard] Starting WGDashboard with Gunicorn in the background.
2024-08-24 04:27:33 /opt/wireguarddashboard/src/wgd.sh: line 308: sudo: command not found

@NOXCIS
Copy link
Contributor

NOXCIS commented Aug 24, 2024

@donaldzou How are you testing alpine?

@donaldzou
Copy link
Owner

donaldzou commented Aug 24, 2024

Hi all, please view this install script on Alpine linux. We might need to change some commands for Docker but this works on the standard Alpine Linux ISO:

Note

On line 3, please replace it with the fastest repo for you :)

setup-interfaces -a ; \
rc-service networking --quiet start ; \
printf "https://mirrors.aliyun.com/alpine/latest-stable/main\nhttps://mirrors.aliyun.com/alpine/latest-stable/community" > /etc/apk/repositories ; \
apk update ; \
apk add wireguard-tools python3 python3-dev git iptables net-tools gcc musl-dev linux-headers sudo ; \
git clone -b v4.0-alpine-linux https://github.com/donaldzou/WGDashboard.git ; \
cd ./WGDashboard/src ; \
chmod +x ./wgd.sh ; \
./wgd.sh install

@NOXCIS, I'm using this command. Had to install sudo tho (line 5)

@NOXCIS
Copy link
Contributor

NOXCIS commented Aug 24, 2024

@donaldzou Which do you think is better?
Image with C dev kit or Image with precompiled binaries but reduces python venv isolation?

@donaldzou
Copy link
Owner

@NOXCIS I think is better to have C dev tools pre installed, but leave the Python stuff to be download it fresh? And I feel like installing the C dev tools takes much longer than installing Python venv

@NOXCIS
Copy link
Contributor

NOXCIS commented Aug 24, 2024

Build times are not practical for 32bit ARM when installing the dev tools and trying to compile psutil & bcrypt. However I still agree with you on installing the dev tools over giving the venv access to site system packages even if the whole thing is containerized. I'll look into other options so i can keep running this on a potato 🥔 if need be.

@NOXCIS
Copy link
Contributor

NOXCIS commented Aug 24, 2024

@donaldzou Nevermind its two lines
{ apk update; apk add python3 net-tools python3-dev; printf "\n\n"; } &>> ./log/install.txt

apk add --no-cache sudo gcc musl-dev linux-headers && \

prebuilt potato chips are good.

@donaldzou
Copy link
Owner

Should we still keep it if someone used Alpine without Docker😂😂

@NOXCIS
Copy link
Contributor

NOXCIS commented Aug 24, 2024

@donaldzou
Screenshot 2024-08-24 at 5 49 25 PM
Two stage docker build

@DaanSelen
Copy link
Collaborator Author

DaanSelen commented Aug 24, 2024

@donaldzou
Screenshot 2024-08-24 at 5 49 25 PM
Two stage docker build

Do you want to use multistage builds to compile bcrypt and psutil modules?

@NOXCIS
Copy link
Contributor

NOXCIS commented Aug 24, 2024

@donaldzou @DaanSelen
Screenshot 2024-08-24 at 6 37 46 PM
I got a working build just need to do some clean up.

@DaanSelen
Copy link
Collaborator Author

@donaldzou @DaanSelen
Screenshot 2024-08-24 at 6 37 46 PM
I got a working build just need to do some clean up.

If you reference the code somewhere I can look at the code later.

@NOXCIS
Copy link
Contributor

NOXCIS commented Aug 24, 2024

@DaanSelen Sure i just have to do some clean up, it was alot of trial and error

@donaldzou
Screenshot 2024-08-24 at 5 49 25 PM
Two stage docker build

Do you want to use multistage builds to compile bcrypt and psutil modules?

Yeah thats how i got the image to be so small without poking holes in the python venv.

@NOXCIS
Copy link
Contributor

NOXCIS commented Aug 25, 2024

@DaanSelen @donaldzou Alpine Docker build here
ARM 32 bit takes ~400 seconds to build

@donaldzou
Copy link
Owner

Let me know if the clean up is done and I can merge it into main :)

@DaanSelen
Copy link
Collaborator Author

The new Docker configuration removed a lot of features while breaking others, why has this been merged with main?

@NOXCIS
Copy link
Contributor

NOXCIS commented Aug 26, 2024

@DaanSelen Im working on a dotenv implement to safely pass environment variables via a .env file. Check out my Wiregate repo prion branch for an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants