Alpine Install Composer

2/13/2022by admin

FROM php:7.2-alpine AS deps ARG COMPOSERAUTH # install composer # add app code # Install deps RUN composer.phar install -no-dev -classmap-authoritative Build arguments are available in the environment to running commands, so the RUN composer.phar install stanza will see and use that COMPOSERAUTH value to do its work.

  • Installing a fresh laravel project, so head over to the terminal, type the command, and create a new laravel app. Composer create-project laravel/laravel alpine-js. Enter fullscreen mode. Exit fullscreen mode.
  • To finish installing Tailwind, you must create a new tailwind.config.js file in the root of your project. The easiest way to do this is by running npm tailwindcss init. In tailwind.config.js, enable JIT mode, register the plugins you installed, and add custom colors used by the form builder.
  • Composer is a popular dependency management tool for PHP, created mainly to facilitate installation and updates for project dependencies. It will check which other packages a specific project depends on and install them for you, using the appropriate versions according to the project requirements.
  • 1New users: hostname and network wired connection
    • 1.2Network configuration
  • 2New users: installing needed packages
  • 3New users: management of users and logins
  • 5Alpine package management behavior
    • 5.3Alpine APK quick infrastructure

As explained in Alpine Linux:Overview, the system will always be minimalist. If you expected behavior like other fancy windows-type linux, that's not the case here!

Packages provide the basic components of an operating system, along with shared libraries, applications, services, and documentation.

This document will guide new users through basic needs about:

  1. installing packages (software to install) and ..
  2. minimal setups (configurations to the system).

If more information is needed, see the Alpine package management behavior section in this document page.

New users: hostname and network wired connection

After installing Alpine Linux, you might need to configure your system to properly work for your use case, since Alpine's main utilities are busybox-based.

Setting the hostname

A hostname is a unique name created to identify a machine on a network, configured in /etc/hostname.To change the computer's hostname edit the /etc/hostname file or execute the following command(make sure to replace myhostname with your desired hostname):

You should add the hostname to your hosts file (/etc/hosts):

Network configuration

There are three types of internet connections: wired (Ethernet), wireless (WiFi) and PPTP (modems).This section will focus only on wired connections, for wireless configuration see the Connecting to a wireless access point article.

This section will help you update and configure your network interfaces. Connect your network cable, then at the console, run the DNS and interfaces configuration scripts.

Note: Since you just installed the OS, we will assume you already have a wired network connection. If you have special needs with respect to networking, see Alpine newbie network and internet connections to set up your internet connection
Default root configuration

The root user is the god of the Linux Alpine system and must not be used as normal user for common tasks. For non-root users, the last section of this document will show you what you need to know.

When Alpine Linux is first installed, by default the user root has no password set. So the first step after booting into a fresh Alpine install is set a password for the user root. If during install, setup-alpine was run to change the root password, it will already be set and can be changed with the setup steps described here. More info is in the Setting users wiki page.

Change 'secret_new_root_password' to your password.

New users: installing needed packages

Packages and programs on alpine are described on Alpine_newbie: Packages overall info. The /community repository of each Alpine release contains community supported packages that were accepted from the /testing repository. Only the /main repository of each released version of Alpine is supported for some Main Alpine Developers and Man Powers.

Note: Alpine Linux needs an internet connection available regardless of the minimal installer
enable repository packages

Repositories are needed to retrieve packages as described on Alpine_newbie: Packages overall info, run:

This will enable the /community and /main repository branches on your instance of Alpine.

install basic tools

As explained in Alpine Linux:Overview, Alpine will always be minimalist. If you expected a behavior like other Linux distributions, the similarity to them will be minimal at best. Run:

manpages in alpine

In the previous section, we noted that some packages have a 'xxx-doc' file. As explained in Alpine Linux:Overview, the system always will be minimalistic. If you want the manpages for a software package, install the 'xxx-doc' package.


Take into consideration that in some earlier versions of alpine, some packages might not have a doc package available.

coreutils libc and utmps in alpine

Some programs like wall(1) depend on a libc feature named 'utmp', that cannot be implementedin libc securely. For this reason, musl (the libc that Alpine uses) does not implement utmp. Instead, it provides stubs that do nothing.

That is why programs that use utmp - such as wall, who or w - output nothing but still exit successfully. This is expected, a feature, and cannot be fixed easily.

Some have a nice solution. For example, a utmps login monitor is only in the 'edge' repositories. So let's do that to learn how. We'll activate the edge repository, temporarily install the software, then deactivate it later:

Warning: Do not install 'all/always' packages from edge, only those not present in main/community. In the commands, coreutils and/or ubase must be installed before changing to edge mixed. If not, then future security patches not will be installed because edge is the unstable repository, and security patches are applied to to the stable one in the main repo. That's why in the next command we first install coreutils then, change to edge to install the utmps package.

Note: Take into consideration that there's an alternative to coreutils named ubase (with a doc package) that provides better functionality than the built-in busybox, but less than what coreutils offers
fonts and fonts configuration

Default internal fb fonts (tty console) or xorg fonts (desktops) are suitable for a default installation. If you can't see your language, you need to install the font that has glyphs (little pictures) created for it. font-misc-misc is installed with X server, so fonts for most languages (Japanese, Korean, Latin, Cyrillic) are already covered. Exceptions are Arabic, Persian, Thai, Tamil, etc. according to the Wikipedia Page on languages for article translation. For complete info about fonts in Alpine see Fonts configurations and settings in Alpine. That section should cover the needs of most users:

These selections will cover most languages and are a good fit for most setups:

These selections add special support for cyrillic languages like Russian and Serbian, etc.:

These selections cover special Asiatic languages like Japanese, etc.:

The following will add some partially supported Chinese fonts:

These selection will cover, in general Arabic, Thai, Ethiopic, Hebrew, Romanian, Persian, Korean Hangul, Greek, Persian, Russian/Slavic Cyrillic, Macedonian/Serbian, Armenian, Georgian, Lao, Devanagari, Urdu (Hindustani as in Northern India and Pakistan), Cherokee, Thaana languages support for desktop setups:

The system font directory is located at /usr/share/fonts. User font location is at ~/.font for security reasons. Configurations are by X server, using the ~/.Xresources file.

Per-user Configuration is made in ~/.fonts.confbut it's hard to configure. An easier method is to use the~/.Xresources file.

The following will set up for all users, a minimal resource usage for fonts. No antialiasing. No hint, etc. :

apk packages for sound base

Currently, alsa is the basic package for Alpine Linux sound. For desktop systems there's gstreamer, phonon and pulseaudio but that will be merged into the desktop wiki pages:

Tip: Modern machines have dual GPU and dual Sound cards, the second ones are always primary and are a HDMI class sound card. Typically they are incorrectly detected, so their configuration must be fixed › Rajeshisnepali › D4630a8eb87ffc31php7.3-alpine-composer (Dockerfile) · GitHub

Alsa service is not started on install, you need to start it and to add it to rc.

New users: management of users and logins

When Alpine Linux is first installed, by default, the user root has no password. So the first step after booting into a feash Alpine installation is to set the root password. If during install, setup-alpine was run to change root password, it will already be assigned and may be changed with the setup steps described here. More info is on the Setting users wiki page.

Users creation and defaults

Only root can manage users. Creating an account enables that account to have it's own $HOME directory and enables you to limit access to the configuration of the operating system for security reasons. The following commands will first set up the root environment login then assign a new password:

By default, SSH security prevents remote management directly with the root account. You'll need to setup a remote connection account and use the 'su' command once you're connected.

Docker Alpine Install Composer

An example of one method is to have a user named 'remote' and a non-privileged user named 'general.' We'll set up a hardened limited environment and create those two users:

Tip: 'general' and 'remote' are the names of the users, MUST be only lowercase, no spaces, no symbols

Note: those users are created with minimal settings. Replace 'secret_new_remote_user_password' and 'secret_new_general_user_password' with secure passwords.
The two passwords should NOT be the same!

Users management and system access

This user will not have enough privileges for general operating purposes. Alpine comes with high security so the administrator (the root account owner) must manage that user.
Take care, for a server, there's no similar procedure!

User management can be done with the default busybox, but there's a few packages that make life easier for an administrator. We'll use the libuser package from the testing repository:

Now we can change some defaults and add the user to the desired groups to access devices or perform connections. Here is a list of the recommended groups the user should be a member of:

  • disk:x:6:root,adm Only if need usage vith virtual machines and access to other partitions over new disks for
  • lp:x:7:lp IF will need to use printing services and printers management
  • floppy:x:11:root Backguard compatible group, use only if need access to external special devices
  • audio:x:18: Need for audio listening and management of sound volumes as normal user
  • cdrom:x:19: For access to disck writers and mounting DVD, BR or CD rom disk as normal user
  • dialout:x:20:root Need for dial private connections and use of modems as normal users
  • tape:x:26:root Need have into this if plan to use special devices for backup.. rarelly in no servers
  • video:x:27:root For usage of cameras, mor thant one GPU special features, as normal user
  • netdev:x:28: For network connections management as normal user
  • kvm:x:34:kvm Only if as normal user will manage graphically virtual machines.. rarelly on no servers
  • games:x:35: Need if you want to play games also specially need if will share score between users
  • cdrw:x:80: To write RW-DVD, RW-BR or RW-CD disk on a disk writing device
  • apache:x:81: Need if you will perfom development as normal user and want to publish locally on web server
  • usb:x:85: Need to access to special usb devices, deprecated group
  • users:x:100:games If you plan to used common files for all users, mandatory as desktop usage

Now that we have libuser, we can change the default shell:

  • If you want to change the current user's shell, log in as that user, then inside a terminal session, execute::
  • If you want to change a different user's shell, run as administrator or as root: › Blogs › How-to-install-alpinejs-in-laHow To Install Alpine.js In Laravel 8 - LaraInfo

where 'general' is a valid user name.

Alpine Install Composer

Continue to Desktop

Before you continue, you must perform the steps in the section described: New users: common needed package to install!

Previous requiredWhat's next to read
Alpine newbie install manualAlpine newbie desktops

Alpine package management behavior

This section is not for new users. Please go to Alpine newbie desktops or Alpine Newbies: Xorg and Openbox if you only want to set up your system.

Programs, the software installed on Alpine, come from two places. A repository with the following structure: http://<host>/alpine/<version>/<brach> (a URL that can be invoked with apk listed in the /etc/apk/repositories file) and original upstream sources (those compiled in the traditonal Unix-like way).

As a new user, you can read the Alpine newbie apk packages page, but please read the rest of this section too:

Alpine Software Packages

Alpine software repositories have main packages and user contributed packages. Each Alpine release has two repository braches.The /community repository of each Alpine release contains community supported packages that were accepted from the /testing repository. Only /main repository of each version of Alpine release is supported for some Main Alpine Developers and Man Powers.

  • Main: Main packages are the Alpine software that has direct support and updates from the Alpine core and main team. They also have official special documentation, are always available for all releases and will have substitutions if some are not continued from upstream. Commonly, those packages are selected due to their responsibility and stability with respect to upstream availability. When those in testing perform well or are mature, they go to the main branch.
  • User Contributed: User-contributed package repositories are those made by users in concert with the official developers and integrated into the Alpine packages. They are user supported. That support could end if the user ends support with respect to Alpine work. For example, could not include substitution in next release due to lack of support by the upstream author. They are in testing and when accepted, go to the community branch.
  • Testing: New packages come into testing repositories of the edge Alpine version and are those made by any contributor or man power on Alpine. The edge contains unstable current development content. This branch has no release linked or related to Alpine. They are in testing and when accepted, go to the community branch.
Alpine APK user resources

Alpine new users have two resources for package management. The page, a search-friendly way, and the Alpine newbie apk packages page that describes how to use the apk-tool.

Alpine APK quick infrastructure

Software packages for Alpine Linux are digitally signed tar.gz archives containing programs, configuration files, and dependency metadata. They have the extension .apk, and are often called 'a-packs'.

Alpine Install Composer Software

The apk command located at /sbin/apk manages package retreval. The apk configuration files are stored in /etc/apk/. 'a-packs' downloaded from repositories are stored in /etc/apk/cache before being unpacked andinstalled into the system.

Table of busybox sustitutions


Table of comparison with other Linux/Unix-like OSes for packages


OSFile FormatTools

Alpine Install Composer Pro

Previous requiredWhat's next to read
Alpine newbie install manualAlpine newbie desktops
Retrieved from ''
Comments are closed.