Browse Source

Generate a static Linux executable within an Alpine linux container

default_compile_flags
vector-of-bool 4 years ago
parent
commit
3830fe556b
2 changed files with 24 additions and 1 deletions
  1. +11
    -1
      Makefile
  2. +13
    -0
      tools/Dockerfile.alpine

+ 11
- 1
Makefile View File



.PHONY: \ .PHONY: \
docs docs-server docs-watch docs-sync-server nix-ci linux-ci macos-ci \ docs docs-server docs-watch docs-sync-server nix-ci linux-ci macos-ci \
vagrant-freebsd-ci site
vagrant-freebsd-ci site alpine-static-ci


_invalid: _invalid:
echo "Specify a target name to execute" echo "Specify a target name to execute"
-B download \ -B download \
-T tools/gcc-9-rel.jsonc -T tools/gcc-9-rel.jsonc


alpine-static-ci:
docker build -t dds-builder -f tools/Dockerfile.alpine tools/
docker run \
-ti --rm \
-u $(shell id -u) \
-v $(PWD):/host -w /host \
--privileged \
dds-builder \
make linux-ci

vagrant-freebsd-ci: vagrant-freebsd-ci:
vagrant up freebsd11 vagrant up freebsd11
vagrant rsync vagrant rsync

+ 13
- 0
tools/Dockerfile.alpine View File

FROM alpine:3.12.1

# Base build dependencies
RUN apk add "gcc=9.3.0-r2" "g++=9.3.0-r2" make python3 py3-pip \
git openssl-libs-static openssl-dev

# We use version-qualified names for compiler executables
RUN ln -s $(type -P gcc) /usr/local/bin/gcc-9 && \
ln -s $(type -P g++) /usr/local/bin/g++-9

# Some Python test dependencies
RUN python3 -m pip install pytest pytest-xdist \
pytest-asyncio semver typing-extensions

Loading…
Cancel
Save