Docker-alpine: What is the alpine equivalent to build-essential?

Created on 5 Apr 2015  Â·  18Comments  Â·  Source: gliderlabs/docker-alpine

When npm installs mongoose it compiles the c++ bson extension.

On Ubuntu build-essential must be installed in npm install is executed.

What is the equivalent package for alpine?

Most helpful comment

What is the equivalent package for alpine?

You can start with alpine-sdk, which is a "metapackage that pulls in the most essential packages used to build new packages." http://wiki.alpinelinux.org/wiki/Developer_Documentation has more info.

user@devenv:~$ docker run --rm -it alpine sh
/ # apk add --update alpine-sdk
fetch http://dl-4.alpinelinux.org/alpine/v3.1/main/x86_64/APKINDEX.tar.gz
(1/50) Upgrading musl (1.1.5-r2 -> 1.1.5-r3)
Executing musl-1.1.5-r3.post-upgrade
(2/50) Upgrading musl-utils (1.1.5-r2 -> 1.1.5-r3)
(3/50) Installing fakeroot (1.20.2-r2)
(4/50) Installing sudo (1.8.12-r0)
(5/50) Installing pax-utils (0.8.1-r0)
(6/50) Installing openssl (1.0.1m-r1)
(7/50) Installing run-parts (4.4-r0)
(8/50) Installing lua5.2-libs (5.2.3-r0)
(9/50) Installing lua5.2 (5.2.3-r0)
(10/50) Installing lua5.2-posix (32-r1)
(11/50) Installing ca-certificates (20141019-r0)
(12/50) Installing libssh2 (1.4.3-r0)
(13/50) Installing curl (7.39.0-r0)
(14/50) Installing abuild (2.21.0-r0)
Executing abuild-2.21.0-r0.pre-install
(15/50) Installing binutils-libs (2.24-r3)
(16/50) Installing binutils (2.24-r3)
(17/50) Installing libgomp (4.8.3-r0)
(18/50) Installing pkgconf (0.9.7-r0)
(19/50) Installing pkgconfig (0.25-r1)
(20/50) Installing gmp5 (5.1.3-r0)
(21/50) Installing mpfr3 (3.1.2-r0)
(22/50) Installing mpc1 (1.0.1-r0)
(23/50) Installing gcc (4.8.3-r0)
(24/50) Installing make (4.1-r0)
(25/50) Installing patch (2.7.5-r0)
(26/50) Installing musl-dbg (1.1.5-r3)
(27/50) Installing musl-dev (1.1.5-r3)
(28/50) Installing linux-headers (3.12.6-r1)
(29/50) Installing libc-dev (0.6-r0)
(30/50) Installing libgcc (4.8.3-r0)
(31/50) Installing libstdc++ (4.8.3-r0)
(32/50) Installing g++ (4.8.3-r0)
(33/50) Installing build-base (0.3-r0)
(34/50) Installing expat (2.1.0-r1)
(35/50) Installing pcre (8.36-r1)
(36/50) Installing git (2.2.1-r0)
(37/50) Installing xz-libs (5.0.7-r0)
(38/50) Installing lzo (2.08-r0)
(39/50) Installing squashfs-tools (4.3-r0)
(40/50) Installing file (5.22-r0)
(41/50) Installing bzip2 (1.0.6-r3)
(42/50) Installing libbz2 (1.0.6-r3)
(43/50) Installing libattr (2.4.47-r3)
(44/50) Installing libcap (2.24-r0)
(45/50) Installing cdrkit (1.1.11-r2)
(46/50) Installing acct (6.6.1-r0)
(47/50) Installing lddtree (1.25-r1)
(48/50) Installing mkinitfs (2.7.1-r1)
(49/50) Installing mtools (4.0.18-r0)
(50/50) Installing alpine-sdk (0.4-r1)
Executing busybox-1.22.1-r14.trigger
Executing ca-certificates-20141019-r0.trigger
OK: 151 MiB in 63 packages

All 18 comments

Not hard to figure out. What's in build-essential?
http://packages.ubuntu.com/lucid/build-essential

Mainly g++ and make:
http://pkgs.alpinelinux.org/package/main/x86/g++
http://pkgs.alpinelinux.org/package/main/x86/make

On Sun, Apr 5, 2015 at 2:31 AM, Douglas Ferguson [email protected]
wrote:

When npm installs mongoose it compiles the c++ bson extension.

On Ubuntu build-essential must be installed in npm install is executed.

What is the equivalent package for alpine?

—
Reply to this email directly or view it on GitHub
https://github.com/gliderlabs/docker-alpine/issues/24.

Jeff Lindsay
http://progrium.com

What is the equivalent package for alpine?

You can start with alpine-sdk, which is a "metapackage that pulls in the most essential packages used to build new packages." http://wiki.alpinelinux.org/wiki/Developer_Documentation has more info.

user@devenv:~$ docker run --rm -it alpine sh
/ # apk add --update alpine-sdk
fetch http://dl-4.alpinelinux.org/alpine/v3.1/main/x86_64/APKINDEX.tar.gz
(1/50) Upgrading musl (1.1.5-r2 -> 1.1.5-r3)
Executing musl-1.1.5-r3.post-upgrade
(2/50) Upgrading musl-utils (1.1.5-r2 -> 1.1.5-r3)
(3/50) Installing fakeroot (1.20.2-r2)
(4/50) Installing sudo (1.8.12-r0)
(5/50) Installing pax-utils (0.8.1-r0)
(6/50) Installing openssl (1.0.1m-r1)
(7/50) Installing run-parts (4.4-r0)
(8/50) Installing lua5.2-libs (5.2.3-r0)
(9/50) Installing lua5.2 (5.2.3-r0)
(10/50) Installing lua5.2-posix (32-r1)
(11/50) Installing ca-certificates (20141019-r0)
(12/50) Installing libssh2 (1.4.3-r0)
(13/50) Installing curl (7.39.0-r0)
(14/50) Installing abuild (2.21.0-r0)
Executing abuild-2.21.0-r0.pre-install
(15/50) Installing binutils-libs (2.24-r3)
(16/50) Installing binutils (2.24-r3)
(17/50) Installing libgomp (4.8.3-r0)
(18/50) Installing pkgconf (0.9.7-r0)
(19/50) Installing pkgconfig (0.25-r1)
(20/50) Installing gmp5 (5.1.3-r0)
(21/50) Installing mpfr3 (3.1.2-r0)
(22/50) Installing mpc1 (1.0.1-r0)
(23/50) Installing gcc (4.8.3-r0)
(24/50) Installing make (4.1-r0)
(25/50) Installing patch (2.7.5-r0)
(26/50) Installing musl-dbg (1.1.5-r3)
(27/50) Installing musl-dev (1.1.5-r3)
(28/50) Installing linux-headers (3.12.6-r1)
(29/50) Installing libc-dev (0.6-r0)
(30/50) Installing libgcc (4.8.3-r0)
(31/50) Installing libstdc++ (4.8.3-r0)
(32/50) Installing g++ (4.8.3-r0)
(33/50) Installing build-base (0.3-r0)
(34/50) Installing expat (2.1.0-r1)
(35/50) Installing pcre (8.36-r1)
(36/50) Installing git (2.2.1-r0)
(37/50) Installing xz-libs (5.0.7-r0)
(38/50) Installing lzo (2.08-r0)
(39/50) Installing squashfs-tools (4.3-r0)
(40/50) Installing file (5.22-r0)
(41/50) Installing bzip2 (1.0.6-r3)
(42/50) Installing libbz2 (1.0.6-r3)
(43/50) Installing libattr (2.4.47-r3)
(44/50) Installing libcap (2.24-r0)
(45/50) Installing cdrkit (1.1.11-r2)
(46/50) Installing acct (6.6.1-r0)
(47/50) Installing lddtree (1.25-r1)
(48/50) Installing mkinitfs (2.7.1-r1)
(49/50) Installing mtools (4.0.18-r0)
(50/50) Installing alpine-sdk (0.4-r1)
Executing busybox-1.22.1-r14.trigger
Executing ca-certificates-20141019-r0.trigger
OK: 151 MiB in 63 packages

Actually that points out the clearest, most similar package to
build-essential for your purpose:
http://pkgs.alpinelinux.org/package/main/x86/build-base

On Sun, Apr 5, 2015 at 8:35 AM, Paul Morgan [email protected]
wrote:

What is the equivalent package for alpine?

You can start with alpine-sdk, which is a "metapackage that pulls in the
most essential packages used to build new packages."
http://wiki.alpinelinux.org/wiki/Developer_Documentation has more info.

user@devenv:~$ docker run --rm -it alpine sh/ # apk add --update alpine-sdkfetch http://dl-4.alpinelinux.org/alpine/v3.1/main/x86_64/APKINDEX.tar.gz(1/50) Upgrading musl (1.1.5-r2 -> 1.1.5-r3)Executing musl-1.1.5-r3.post-upgrade(2/50) Upgrading musl-utils (1.1.5-r2 -> 1.1.5-r3)(3/50) Installing fakeroot (1.20.2-r2)(4/50) Installing sudo (1.8.12-r0)(5/50) Installing pax-utils (0.8.1-r0)(6/50) Installing openssl (1.0.1m-r1)(7/50) Installing run-parts (4.4-r0)(8/50) Installing lua5.2-libs (5.2.3-r0)(9/50) Installing lua5.2 (5.2.3-r0)(10/50) Installing lua5.2-posix (32-r1)(11/50) Installing ca-certificates (20141019-r0)(12/50) Installing libssh2 (1.4.3-r0)(13/50) Installing curl (7.39.0-r0)(14/50) Installing abuild (2.21.0-r0)Executing abuild-2.21.0-r0.pre-install(15/50) Installing binutils-libs (2.24-r3)(16/50) Installing binutils (2.24-r3)(17/50) Installing libgomp (4.8.3-r0)(18/50) Installing pkgconf (0.9.7-r0)(19/50) Installing pkgconfig (0.25-r1)(20/50) Installing gmp5 (5.1.3-r0)(21/50) Installing mpfr3 (3.1.2-r0)(22/50) Installing mpc1 (1.0.1-r0)(23/50) Installing gcc (4.8.3-r0)(24/50) Installing make (4.1-r0)(25/50) Installing patch (2.7.5-r0)(26/50) Installing musl-dbg (1.1.5-r3)(27/50) Installing musl-dev (1.1.5-r3)(28/50) Installing linux-headers (3.12.6-r1)(29/50) Installing libc-dev (0.6-r0)(30/50) Installing libgcc (4.8.3-r0)(31/50) Installing libstdc++ (4.8.3-r0)(32/50) Installing g++ (4.8.3-r0)(33/50) Installing build-base (0.3-r0)(34/50) Installing expat (2.1.0-r1)(35/50) Installing pcre (8.36-r1)(36/50) Installing git (2.2.1-r0)(37/50) Installing xz-libs (5.0.7-r0)(38/50) Installing lzo (2.08-r0)(39/50) Installing squashfs-tools (4.3-r0)(40/50) Installing file (5.22-r0)(41/50) Installing bzip2 (1.0.6-r3)(42/50) Installing libbz2 (1.0.6-r3)(43/50) Installing libattr (2.4.47-r3)(44/50) Installing libcap (2.24-r0)(45/50) Installing cdrkit (1.1.11-r2)(46/50) Installing acct (6.6.1-r0)(47/50) Installing lddtree (1.25-r1)(48/50) Installing mkinitfs (2.7.1-r1)(49/50) Installing mtools (4.0.18-r0)(50/50) Installing alpine-sdk (0.4-r1)Executing busybox-1.22.1-r14.triggerExecuting ca-certificates-20141019-r0.triggerOK: 151 MiB in 63 packages

—
Reply to this email directly or view it on GitHub
https://github.com/gliderlabs/docker-alpine/issues/24#issuecomment-89770836
.

Jeff Lindsay
http://progrium.com

Re-open if this wasn't what you were looking for.

https://pkgs.alpinelinux.org/package/v3.6/main/ppc64le/build-base is the latest link. The one in the other comment is now a 404.

If you are coming here from the future, you probably want to go here: https://pkgs.alpinelinux.org/packages?name=build-base&branch=&repo=&arch=&maintainer=

and pick the latest version (or correct version for whatever you are doing)

RUN apk update \
&& apk add --virtual build-dependencies \
build-base \
gcc \
wget \
git

What's the difference between build-base vs build-dependencies?

@javierojeda94 build-dependencies isn't an alpine package. The --virtual tag allows you to add the following packages as a virtual group, for managing as a single package. For example, after that operation you could do apk del build-dependencies and it would delete all of those packages

Oh! Ok, so with that --virtual I'm able to install that build-dependencies package despite the fact that it is not an alpine package?

Does that work the same with another non-alpine packages?

Sorry for dumb questions, I'm new on alpine

@javierojeda94 Not quite. With the --virtual tag the argument immediately following is what the group is named. The command above creates a group called build-dependencies, consisting of build-base, gcc, wget, and git, and then installs those 4 packages.

Oh, that makes much more sense to me now! Thanks for the clarification!

apk add build-base

If you follow the above and still get cryptograpghy error when running in .gitlab-ci.yml file with runner deployed in AWS

  • apk add --update alpine-sdk && \
  • apk add libffi-dev openssl-dev && \
  • apk --no-cache --update add build-base

I tried every possible combination given in this thread. still getting this issue.

using python3 and pip3 in an alpine image

Collecting cryptography>=2.1.4 (from azure-storage-blob==12.3.1->-r ./requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/56/3b/78c6816918fdf2405d62c98e48589112669f36711e50158a0c15d804c30d/cryptography-2.9.2.tar.gz (517kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
Complete output from command /usr/bin/python3.6 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-0olxhwr0 --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=40.6.0 wheel "cffi>=1.8,!=1.11.3; platform_python_implementation != 'PyPy'":
Collecting setuptools>=40.6.0
Downloading https://files.pythonhosted.org/packages/a0/df/635cdb901ee4a8a42ec68e480c49f85f4c59e8816effbf57d9e6ee8b3588/setuptools-46.1.3-py3-none-any.whl (582kB)
Collecting wheel
Downloading https://files.pythonhosted.org/packages/8c/23/848298cccf8e40f5bbb59009b32848a4c38f4e7f3364297ab3c3e2e2cd14/wheel-0.34.2-py2.py3-none-any.whl
Collecting cffi!=1.11.3,>=1.8
Downloading https://files.pythonhosted.org/packages/05/54/3324b0c46340c31b909fcec598696aaec7ddc8c18a63f2db352562d3354c/cffi-1.14.0.tar.gz (463kB)
Collecting pycparser (from cffi!=1.11.3,>=1.8)
Downloading https://files.pythonhosted.org/packages/ae/e7/d9c3a176ca4b02024debf82342dab36efadfc5776f9c8db077e8f6e71821/pycparser-2.20-py2.py3-none-any.whl (112kB)
Installing collected packages: setuptools, wheel, pycparser, cffi
Running setup.py install for cffi: started
Running setup.py install for cffi: finished with status 'error'
Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-tnyaa9v8/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-ezer4lka/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-0olxhwr0 --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/cffi
copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.6/cffi
copying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.6/cffi
copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.6/cffi
copying cffi/cparser.py -> build/lib.linux-x86_64-3.6/cffi
copying cffi/error.py -> build/lib.linux-x86_64-3.6/cffi
copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.6/cffi
copying cffi/__init__.py -> build/lib.linux-x86_64-3.6/cffi
copying cffi/model.py -> build/lib.linux-x86_64-3.6/cffi
copying cffi/commontypes.py -> build/lib.linux-x86_64-3.6/cffi
copying cffi/verifier.py -> build/lib.linux-x86_64-3.6/cffi
copying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.6/cffi
copying cffi/recompiler.py -> build/lib.linux-x86_64-3.6/cffi
copying cffi/pkgconfig.py -> build/lib.linux-x86_64-3.6/cffi
copying cffi/lock.py -> build/lib.linux-x86_64-3.6/cffi
copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.6/cffi
copying cffi/api.py -> build/lib.linux-x86_64-3.6/cffi
copying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.6/cffi
copying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.6/cffi
copying cffi/_embedding.h -> build/lib.linux-x86_64-3.6/cffi
copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.6/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/c
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/python3.6m -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.6/c/_cffi_backend.o
c/_cffi_backend.c:2:10: fatal error: Python.h: No such file or directory
#include
^~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1

   ----------------------------------------

Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-tnyaa9v8/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-ezer4lka/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-0olxhwr0 --compile" failed with error code 1 in /tmp/pip-install-tnyaa9v8/cffi/
You are using pip version 18.1, however version 20.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.


Command "/usr/bin/python3.6 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-0olxhwr0 --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=40.6.0 wheel "cffi>=1.8,!=1.11.3; platform_python_implementation != 'PyPy'"" failed with error code 1 in None
You are using pip version 18.1, however version 20.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
ERROR: Job failed: exit code 1

  • apk add --update-cache

    • apk add --update alpine-sdk && \

      apk add libffi-dev openssl-dev && \

      apk --no-cache --update add build-base

    • pip3 install -r ./requirements.txt

This is the command I am trying to execute

I know this is quite old, but what is the difference between alpine-sdk and build-base?

@GalacticLion7
Just run apk info -R pkg_name

In a nutshell, alpine-sdk is a superset of build-base:

build-base:
binutils
file
gcc
g++
make
libc-dev
fortify-headers
patch

alpine-sdk:
git
fakeroot
scanelf
openssl
apk-tools
libc-utils
attr
tar
pkgconf
patch
lzip
curl
/bin/sh
so:libc.musl-x86_64.so.1
so:libcrypto.so.1.1
so:libz.so.1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rmNyro picture rmNyro  Â·  4Comments

ncopa picture ncopa  Â·  4Comments

mterzo picture mterzo  Â·  4Comments

frebib picture frebib  Â·  4Comments

sirhopcount picture sirhopcount  Â·  3Comments