build sources for container to provide an build environment for go and rust projects https://hub.docker.com/r/volkerraschek/build-image/
Go to file
Markus Pesch a25147746c Merge pull request 'chore(deps): update git.cryptic.systems/volker.raschek/markdownlint docker tag to v0.39.0' (#19) from renovate/git.cryptic.systems-volker.raschek-markdownlint-0.x into master
Reviewed-on: #19
2024-02-15 17:59:30 +00:00
installation-scripts fix: import own certificate 2022-12-22 16:31:42 +01:00
.drone.yml chore(deps): update git.cryptic.systems/volker.raschek/markdownlint docker tag to v0.39.0 2024-01-28 23:02:37 +00:00
.editorconfig add: travis pipeline 2019-04-18 18:48:31 +02:00
.gitattributes add: travis pipeline 2019-04-18 18:48:31 +02:00
.gitignore fix: makepkg, build user 2022-04-02 16:41:35 +02:00
.markdownlint.yaml fix: update ci 2021-08-31 22:39:00 +02:00
Dockerfile fix: cleanup pkg cache 2023-07-23 11:17:14 +02:00
LICENSE fix(LICENSE): publish build-image under apache 2.0 license 2019-08-25 15:42:25 +02:00
Makefile fix: migrate to git.cryptic.systems 2023-06-18 15:29:45 +02:00
README.md fix: makepkg, build user 2022-04-02 16:41:35 +02:00
entrypoint.sh feat: add ssh and vim, make scp possible 2023-02-05 11:08:57 +01:00
manifest.tmpl fix: migrate to git.cryptic.systems 2023-06-18 15:29:45 +02:00
renovate.json fix(renovate): remove automerge options 2024-01-21 14:34:38 +01:00

README.md

build-image

Build Status Docker Pulls

This project contains all sources to build the container image docker.io/volkerraschek/build-image. The primary goal of the image is only to provide an environment to compile source code for go or rust and package compiled binaries as PKG for Arch Linux or as RPM for RHEL based distributions.

Supported environment variables

gnupg

GNUPG_KEY

Import private gpg key via GPG_KEY. The private key must be escaped to import the key inside the container image correctly. For example:

GPG_FPR=YOUR_GPG_FINGERPRINT
GPG_KEY=$(gpg --armor --export-secret-keys ${GPG_FPR} | cat -e | sed -e 's/\$/\\n/g' -e 's/^[ \t]*//g')

makepkg

The makepkg.conf configuration is composed from the environment variables with the prefix MAKEPKG_. Below are some examples:

MAKEPKG_PACKAGER="Hugo McKinnock <hugo.mckinnock@example.local>" MAKEPKG_GPGKEY="0123456789" MAKEPKG_PKGEXT=.pkg.tar.zst"

ssh

SSH_KEY

Import private ssh key via SSH_KEY. The private key must be escaped to import the key inside the container image correctly. For example:

SSH_KEY=$(cat -e ${HOME}/.ssh/id_rsa | sed -e 's/\$/\\n/g')

Usage

golang

To use this image for building golang applications execute this in your root folder of your go project.

$ docker run \
    --rm \
    --volume ${PWD}:/workspace \
    volkerraschek/build-image:latest \
      go build

makepkg

With the following example will be an package be build for Arch Linux. Execute the commond in the root directory of the project, where the PKGBUILD file is located.

$ docker run \
    --env MAKEPKG_PACKAGER="Max Mustermann <max.mustermann@example.com" \
    --rm \
    --volume ${PWD}:/workspace \
    volkerraschek/build-image:latest \
      makepkg

rust

If you want to compile instead go rust sourcecode, than you can do it similar to the golang example.

$ docker run \
    --rm \
    --volume ${PWD}:/workspace \
    volkerraschek/build-image:latest \
      cargo build --release