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

Feature: Alpine Linux support #663

Closed
phenonymous opened this issue Apr 23, 2019 · 24 comments · Fixed by #1672
Closed

Feature: Alpine Linux support #663

phenonymous opened this issue Apr 23, 2019 · 24 comments · Fixed by #1672
Assignees
Labels
enhancement New feature or request work-in-progress Stale Exempt

Comments

@phenonymous
Copy link
Contributor

phenonymous commented Apr 23, 2019

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
Copy link
Member

nemchik commented Apr 24, 2019

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
Copy link
Contributor Author

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
Copy link
Member

nemchik commented Apr 26, 2019

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

@nemchik nemchik reopened this Apr 26, 2019
@stale
Copy link

stale bot commented Jun 25, 2019

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.

@stale stale bot added the wontfix label Jun 25, 2019
@stale stale bot closed this as completed Jul 2, 2019
@nemchik nemchik removed the wontfix label Dec 4, 2019
@wpmccormick
Copy link

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

@nemchik
Copy link
Member

nemchik commented May 5, 2021

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

@wpmccormick
Copy link

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
Copy link
Member

nemchik commented May 5, 2021

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
Copy link
Contributor Author

phenonymous commented May 5, 2021 via email

@nemchik
Copy link
Member

nemchik commented May 5, 2021

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
Copy link

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
Copy link
Member

nemchik commented Jun 9, 2021

#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 nemchik reopened this Jun 9, 2021
@nemchik nemchik self-assigned this Jun 9, 2021
@nemchik nemchik added the work-in-progress Stale Exempt label Jun 9, 2021
@nemchik nemchik added under-consideration Stale Exempt enhancement New feature or request work-in-progress Stale Exempt and removed work-in-progress Stale Exempt under-consideration Stale Exempt labels Sep 15, 2021
@nemchik
Copy link
Member

nemchik commented May 17, 2022

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
Copy link
Contributor

karl0ss commented Sep 20, 2023

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
Copy link
Member

nemchik commented Sep 20, 2023

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
Copy link
Contributor

karl0ss commented Sep 20, 2023

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
Copy link
Member

nemchik commented Sep 20, 2023

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
Copy link
Member

nemchik commented Sep 20, 2023

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
Copy link
Contributor

karl0ss commented Sep 21, 2023

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
Copy link
Member

nemchik commented Sep 24, 2023

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

@karl0ss
Copy link
Contributor

karl0ss commented Sep 25, 2023

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
Copy link
Contributor

karl0ss commented Sep 25, 2023

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
Copy link
Member

nemchik commented Oct 2, 2023

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
Copy link
Member

nemchik commented Oct 9, 2023

@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.

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

Successfully merging a pull request may close this issue.

4 participants