GhostWriters / DockSTARTer

DockSTARTer helps you get started with running apps in Docker.
https://dockstarter.com/
MIT License
2.21k stars 229 forks source link

Feature: Alpine Linux support #663

Closed phenonymous closed 7 months ago

phenonymous commented 5 years ago

Alpine linux

Alpine Linux is an independent, non-commercial, general purpose Linux distribution designed for power users who appreciate security, simplicity and resource efficiency. About Alpine

Alpine Linux is a tiny, fully functional, Linux system that is a great base for IoT-devices, Raspberry Pi or where space is a concern for the OS. - N.B. these are just examples. It is very popular in container-commuinty because of its image size.

The size does not come without its cost, however, altough many packages exists for Alpine - few of them are installed from the beginning and many of them have other names. As a result adding Alpine support is a bit more complicated than just adding the package manager.

I personally use Alpine and have experience with it. I would like to prepare a PR for this if its alright, I'm sure other users would appreciate the support.

edit: typos

nemchik commented 5 years ago

I'm aware that Alpine has apk but I don't think it's supported by the official docker-ce install script which we use, and I have no idea where it stands with python3 and other dependencies (for compose).

This would require some significant changes to how we handle those things. We've been discussing dependency requirements as well in other places, so I think we should get that handled first and maybe try to set it up for future success in this area?

phenonymous commented 5 years ago

I agree. Let's get #662 out of the way and see how that turns out. Then we can discuss this issue on how alpine would fit the current model. I'll close this issue for the time being.

nemchik commented 5 years ago

No need to close :) just wanted to respond and prioritize.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

wpmccormick commented 3 years ago

any chance this can be freshened and reopened? I'd like to see this.

nemchik commented 3 years ago

This was actually added and should be working. The readme has info.

wpmccormick commented 3 years ago

I looked at a README; perhaps not the right README. I'll take another look. Where is the right place to converse over issues?

nemchik commented 3 years ago

If you search arch in https://github.com/GhostWriters/DockSTARTer or https://dockstarter.com/ (the readme is the home page) you should find the pacman systems instructions.

If you run into any issues you can chat us on discord (links in the readme) or open an issue here https://github.com/GhostWriters/DockSTARTer/issues/new/choose

phenonymous commented 3 years ago

Alpine Linux uses apk and not pacman

Hämta Outlook för Androidhttps://aka.ms/AAb9ysg


From: Eric Nemchik @.> Sent: Wednesday, May 5, 2021 7:41:54 PM To: GhostWriters/DockSTARTer @.> Cc: Kristoffer Minya @.>; State change @.> Subject: Re: [GhostWriters/DockSTARTer] Feature: Alpine Linux support (#663)

If you search arch in https://github.com/GhostWriters/DockSTARTer or https://dockstarter.com/ (the readme is the home page) you should find the pacman systems instructions.

If you run into any issues you can chat us on discord (links in the readme) or open an issue here https://github.com/GhostWriters/DockSTARTer/issues/new/choose

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/GhostWriters/DockSTARTer/issues/663#issuecomment-832882564, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHBHZILEF5KUYFINUQ3YAP3TMF7OFANCNFSM4HHVSHKA.

nemchik commented 3 years ago

Alpine Linux uses apk and not pacman Hämta Outlook för Androidhttps://aka.ms/AAb9ysg ____ From: Eric Nemchik @.> Sent: Wednesday, May 5, 2021 7:41:54 PM To: GhostWriters/DockSTARTer @.> Cc: Kristoffer Minya @.>; State change @.> Subject: Re: [GhostWriters/DockSTARTer] Feature: Alpine Linux support (#663) If you search arch in https://github.com/GhostWriters/DockSTARTer or https://dockstarter.com/ (the readme is the home page) you should find the pacman systems instructions. If you run into any issues you can chat us on discord (links in the readme) or open an issue here https://github.com/GhostWriters/DockSTARTer/issues/new/choose — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub<#663 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHBHZILEF5KUYFINUQ3YAP3TMF7OFANCNFSM4HHVSHKA.

Sorry I misread!

Alpine is not directly supported, but you may be able to get it working by manually installing the dependencies:

curl
git
grep
sed
whiptail (sometimes packaged as newt)
docker

Anything included in busybox probably still needs to be installed manually l.

I am reconsidering supporting more distros in the future.

Sorry again for the mix-up!

wpmccormick commented 3 years ago

Yep. That did it! Thanks!!

[alpine@alpine ~]$ sudo apk add curl git grep sed newt docker (1/3) Installing popt (1.18-r0) (2/3) Installing slang (2.3.2-r0) (3/3) Installing newt (0.52.21-r0) Executing busybox-1.32.1-r6.trigger OK: 1974 MiB in 352 packages [alpine@alpine ~]$ ds

nemchik commented 3 years ago

https://github.com/GhostWriters/DockSTARTer/pull/1321 This PR is the first step towards DS officially supporting alpine. Once that merges I'll still have more work to do, but it opens the door.

nemchik commented 2 years ago

Official support for Alpine should be possible at this point. I'll look into this at some point. The above instructions should work, but you'll also need to install docker compose v2

karl0ss commented 1 year ago

Do I need to be on a specific branch for this? as I am trying to install on alpine and get as far as "Supported package manager not detected!"

dockerct:~$ sudo apk add docker docker-cli-compose

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

For security reasons, the password you type will not be visible.

[sudo] password for karl: 
(1/19) Installing ca-certificates (20230506-r0)
(2/19) Installing libseccomp (2.5.4-r2)
(3/19) Installing runc (1.1.7-r3)
(4/19) Installing containerd (1.7.2-r2)
(5/19) Installing containerd-openrc (1.7.2-r2)
(6/19) Installing libmnl (1.0.5-r1)
(7/19) Installing libnftnl (1.2.5-r1)
(8/19) Installing iptables (1.8.9-r2)
(9/19) Installing iptables-openrc (1.8.9-r2)
(10/19) Installing ip6tables (1.8.9-r2)
(11/19) Installing ip6tables-openrc (1.8.9-r2)
(12/19) Installing tini-static (0.19.0-r1)
(13/19) Installing device-mapper-libs (2.03.21-r3)
(14/19) Installing docker-engine (23.0.6-r5)
(15/19) Installing docker-openrc (23.0.6-r5)
(16/19) Installing docker-cli (23.0.6-r5)
(17/19) Installing docker-cli-buildx (0.10.4-r8)
(18/19) Installing docker (23.0.6-r5)
Executing docker-23.0.6-r5.pre-install
(19/19) Installing docker-cli-compose (2.17.3-r6)
Executing busybox-1.36.1-r0.trigger
Executing ca-certificates-20230506-r0.trigger
OK: 312 MiB in 50 packages

dockerct:~$ sudo apk add curl git grep sed newt docker
(1/14) Installing brotli-libs (1.0.9-r14)
(2/14) Installing libunistring (1.1-r1)
(3/14) Installing libidn2 (2.3.4-r1)
(4/14) Installing nghttp2-libs (1.55.1-r0)
(5/14) Installing libcurl (8.2.1-r0)
(6/14) Installing curl (8.2.1-r0)
(7/14) Installing libexpat (2.5.0-r1)
(8/14) Installing pcre2 (10.42-r1)
(9/14) Installing git (2.40.1-r0)
(10/14) Installing grep (3.10-r1)
(11/14) Installing pcre (8.45-r3)
(12/14) Installing slang (2.3.3-r1)
(13/14) Installing newt (0.52.23-r1)
(14/14) Installing sed (4.9-r2)
Executing busybox-1.36.1-r0.trigger
OK: 325 MiB in 64 packages

dockerct:~$ sudo apk add bash
(1/4) Installing ncurses-terminfo-base (6.4_p20230506-r0)
(2/4) Installing libncursesw (6.4_p20230506-r0)
(3/4) Installing readline (8.2.1-r1)
(4/4) Installing bash (5.2.15-r5)
Executing bash-5.2.15-r5.post-install
Executing busybox-1.36.1-r0.trigger
OK: 327 MiB in 68 packages

dockerct:~$ bash -c "$(curl -fsSL https://get.dockstarter.com)"
2023-09-20 10:33:11 [WARN  ]   Attempting to clone DockSTARTer repo to /home/karl/.docker location.
Cloning into '/home/karl/.docker'...
remote: Enumerating objects: 42254, done.
remote: Counting objects: 100% (42254/42254), done.
remote: Compressing objects: 100% (8029/8029), done.
remote: Total 42254 (delta 24964), reused 42127 (delta 24882), pack-reused 0
Receiving objects: 100% (42254/42254), 18.83 MiB | 11.46 MiB/s, done.
Resolving deltas: 100% (24964/24964), done.
2023-09-20 10:33:18 [NOTICE]   Performing first run install.
2023-09-20 10:33:18 [INFO  ]   Setting permissions for /home/karl/.docker/main.sh
2023-09-20 10:33:18 [INFO  ]   Setting executable permission on /home/karl/.docker/main.sh
2023-09-20 10:33:18 [INFO  ]   Creating /usr/bin/ds symbolic link for DockSTARTer.
2023-09-20 10:33:18 [INFO  ]   Creating /usr/local/bin/ds symbolic link for DockSTARTer.
2023-09-20 10:33:18 [FATAL ]   Supported package manager not detected!
DockSTARTer did not finish running successfully.
nemchik commented 1 year ago

Do I need to be on a specific branch for this? as I am trying to install on alpine and get as far as "Supported package manager not detected!"

From that point, try running ds and go through the full config to see if it can run containers for you. If it can then it's just a matter of adjusting DS to handle the initial installation steps correctly, which should be very doable.

karl0ss commented 1 year ago

Just trying to run ds and installing watchtower returns

sort: unrecognized option: C                                                                                                                                    
BusyBox v1.36.1 (2023-06-02 00:42:02 UTC) multi-call binary.

Usage: sort [-nrughMcszbdfiokt] [-o FILE] [-k START[.OFS][OPTS][,END[.OFS][OPTS]] [-t CHAR] [FILE]...

Sort lines of text

        -o FILE Output to FILE
        -c      Check whether input is sorted
        -b      Ignore leading blanks
        -f      Ignore case
        -i      Ignore unprintable characters
        -d      Dictionary order (blank or alphanumeric only)
        -n      Sort numbers
        -g      General numerical sort
        -h      Sort human readable numbers (2K 1G)
        -M      Sort month
        -V      Sort version
        -t CHAR Field separator
        -k N[,M] Sort by Nth field
        -r      Reverse sort order
        -s      Stable (don't sort ties alphabetically)
        -u      Suppress duplicate lines
        -z      NUL terminated input and output
2023-09-20 17:29:30 [FATAL ]   Supported package manager not detected!
DockSTARTer did not finish running successfully.
nemchik commented 1 year ago

That looks like you don't have GNU sort. I believe alpine has that available in coreutils. Try running

apk add coreutils

then try ds again.

nemchik commented 1 year ago

I've created a branch that should fully work with alpine. To test, run

cd ~/.docker
ds -u origin/apk
ds -fiv
ds

The last command will open the DS menu and you can do into the full config and run like normal. If that works I can publish the branch to master and it will mean Alpine is officially supported.

karl0ss commented 1 year ago
dockerct:~$ cd ~/.docker

dockerct:~/.docker$ ds -u origin/apk
[sudo] password for karl: 
2023-09-21 08:09:43 [NOTICE]   Updating DockSTARTer to origin/apk.
2023-09-21 08:09:49 [NOTICE]   Creating environment variables for enabled apps. Please be patient, this can take a while.

dockerct:~/.docker$ ds -fiv
2023-09-21 08:09:56 [INFO  ]   Setting permissions for /home/karl/.docker/main.sh
2023-09-21 08:09:56 [INFO  ]   Setting executable permission on /home/karl/.docker/main.sh
2023-09-21 08:09:56 [INFO  ]   apk does not require additional repositories.
2023-09-21 08:09:56 [NOTICE]   Upgrading packages. Please be patient, this can take a while.
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
(1/14) Upgrading musl (1.2.4-r0 -> 1.2.4-r1)
(2/14) Upgrading busybox (1.36.1-r0 -> 1.36.1-r2)
Executing busybox-1.36.1-r2.post-upgrade
(3/14) Upgrading busybox-binsh (1.36.1-r0 -> 1.36.1-r2)
(4/14) Upgrading openrc (0.47.1-r0 -> 0.48-r0)
Executing openrc-0.48-r0.post-upgrade
(5/14) Upgrading busybox-mdev-openrc (1.36.1-r0 -> 1.36.1-r2)
(6/14) Upgrading alpine-conf (3.16.1-r1 -> 3.16.2-r0)
(7/14) Upgrading alpine-release (3.18.0-r0 -> 3.18.3-r0)
(8/14) Upgrading libcrypto3 (3.1.1-r1 -> 3.1.3-r0)
(9/14) Upgrading libssl3 (3.1.1-r1 -> 3.1.3-r0)
(10/14) Upgrading ssl_client (1.36.1-r0 -> 1.36.1-r2)
(11/14) Upgrading busybox-openrc (1.36.1-r0 -> 1.36.1-r2)
(12/14) Upgrading busybox-suid (1.36.1-r0 -> 1.36.1-r2)
(13/14) Upgrading musl-utils (1.2.4-r0 -> 1.2.4-r1)
(14/14) Upgrading alpine-base (3.18.0-r0 -> 3.18.3-r0)
Executing busybox-1.36.1-r2.trigger
Executing ca-certificates-20230506-r0.trigger
OK: 327 MiB in 68 packages
2023-09-21 08:09:57 [NOTICE]   Installing dependencies. Please be patient, this can take a while.
(1/4) Installing libattr (2.5.1-r4)
(2/4) Installing skalibs (2.13.1.1-r1)
(3/4) Installing utmps-libs (0.1.2.1-r1)
(4/4) Installing coreutils (9.3-r1)
Executing busybox-1.36.1-r2.trigger
OK: 328 MiB in 72 packages
2023-09-21 08:09:57 [INFO  ]   apk does not require cleanup.
2023-09-21 08:09:57 [NOTICE]   Installing docker. Please be patient, this can take a while.
OK: 328 MiB in 72 packages
2023-09-21 08:09:57 [INFO  ]   Creating docker group.
2023-09-21 08:09:57 [FATAL ]   Failed to create docker group.
Failing command: sudo groupadd -f docker
DockSTARTer did not finish running successfully.
dockerct:~/.docker$ sudo groupadd -f docker
sudo: groupadd: command not found
nemchik commented 12 months ago

Sorry for the late response. try apk add shadow then rerun ds -fiv

karl0ss commented 12 months ago

Hey no problem man, were all busy, just thought I would keep working through with this..

dockerct:~$ sudo apk add shadow
(1/2) Installing linux-pam (1.5.2-r10)
(2/2) Installing shadow (4.13-r4)
Executing busybox-1.36.1-r2.trigger
OK: 331 MiB in 74 packages
dockerct:~$ ds -fiv
2023-09-25 09:16:43 [INFO  ]   Setting permissions for /home/karl/.docker/main.sh
2023-09-25 09:16:43 [INFO  ]   Taking ownership of /home/karl/.docker/main.sh for user 1000 and group 1000
2023-09-25 09:16:43 [INFO  ]   Setting file and folder permissions in /home/karl/.docker/main.sh
2023-09-25 09:16:43 [INFO  ]   Setting executable permission on /home/karl/.docker/main.sh
2023-09-25 09:16:43 [INFO  ]   apk does not require additional repositories.
2023-09-25 09:16:43 [NOTICE]   Upgrading packages. Please be patient, this can take a while.
(1/2) Upgrading libcurl (8.2.1-r0 -> 8.3.0-r0)
(2/2) Upgrading curl (8.2.1-r0 -> 8.3.0-r0)
Executing busybox-1.36.1-r2.trigger
OK: 331 MiB in 74 packages
2023-09-25 09:16:43 [NOTICE]   Installing dependencies. Please be patient, this can take a while.
OK: 331 MiB in 74 packages
2023-09-25 09:16:43 [INFO  ]   apk does not require cleanup.
2023-09-25 09:16:43 [NOTICE]   Installing docker. Please be patient, this can take a while.
OK: 331 MiB in 74 packages
2023-09-25 09:16:44 [INFO  ]   Creating docker group.
2023-09-25 09:16:44 [INFO  ]   Adding karl to docker group.
2023-09-25 09:16:44 [INFO  ]   Systemd detected. Enabling docker service.
2023-09-25 09:16:44 [FATAL ]   Failed to enable docker service.
Failing command: systemctl enable docker
DockSTARTer did not finish running successfully.

Enabling docker on alpine seems to be this process -

Install apk add --update docker openrc

Start manually - service docker start

Set to run at boot - rc-update add docker boot

karl0ss commented 12 months ago

Just to update, it would appear I can actually use ds now, and it is pulling down and starting images fine, I've also made an override yml and it pulled that image down with now issues, so the backend is working, just a couple of incorrect "start commands" in the script I think...

happy to retest in a new ct if you think you get it working end2end..would be nice to have full working alpine support

nemchik commented 11 months ago

I've just pushed an update that should include installing openrc via apk as well as more accurately detecting when systemd is present (or not) and then checking if openrc is present and enabling/starting docker accordingly.

Can you try

ds -u origin/apk
ds -fiv
ds

The ds -fiv should work this time (after the first command, which pulls the latest updates I just made for the alpine testing branch).

nemchik commented 11 months ago

@karl0ss just a reminder ping, once you confirm if the latest changes work end to end I will merge #1672 and alpine will be fully supported.