https://github.com/bkahlert/build-runner

Multiplatform Alpine based SSH accessible Docker image with Docker CLI and OpenJDK 11 installed

https://github.com/bkahlert/build-runner

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.8%) to scientific vocabulary

Keywords

docker docker-image java ssh

Keywords from Contributors

interactive archival projection generic sequences observability autograding hacking shellcodes modular
Last synced: 5 months ago · JSON representation

Repository

Multiplatform Alpine based SSH accessible Docker image with Docker CLI and OpenJDK 11 installed

Basic Info
  • Host: GitHub
  • Owner: bkahlert
  • License: mit
  • Language: Shell
  • Default Branch: master
  • Homepage:
  • Size: 88.9 KB
Statistics
  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • Open Issues: 5
  • Releases: 2
Topics
docker docker-image java ssh
Created over 4 years ago · Last pushed almost 3 years ago
Metadata Files
Readme Changelog Funding License Codeowners

README.md

bkahlert/build-runner Build Status Repository Size Repository Size

About

bkahlert/build-runner is a multiplatform Alpine based SSH accessible Docker image with Docker CLI and OpenJDK 11 installed. It is compatible with IntelliJ IDEA run targets feature.

recorded terminal session demonstrating a successful SSH connection to a running instance of bkahlert/build-runner
SSH connection to a running instance of bkahlert/build-runner

Build locally

```shell git clone https://github.com/bkahlert/build-runner.git cd build-runner

Build image and output to docker (default)

docker buildx bake

Build multi-platform image

docker buildx bake image-all ```

Image

Following platforms for this image are available:

  • linux/amd64
  • linux/arm64/v8

Usage

Run as an application

If you pass arguments to the container, they will be treated like a regular command line. The container will run the command line and terminate.

shell docker run --rm -it \ -v "$(pwd):$(pwd)" \ -w "$(pwd)" \ bkahlert/build-runner:edge \ javac --version

Run as a service / SSH server

Starting the container without any arguments will launch an SSH server that will listen for connections.

By default, authentication uses public key. Since no public key is provided in the bkahlert/build-runner, a public key must be provided at startup:

```shell

start container

docker run -d --rm \ -e AUTHORIZEDKEYS="$(cat ~/.ssh/idrsa.pub)" \ -v "$(pwd):$(pwd)" \ -w "$(pwd)" \ -p 2022:2022 \ "build-runner:edge"

connect

ssh \ -i ~/.ssh/id_rsa \ -o StrictHostKeyChecking=no \ -o UserKnownHostsFile=/dev/null \ -o LogLevel=ERROR \ -p 2022 \ "runner@localhost" \ id ```

Alternatively a password can be provided which enables password and disables public key authentication:

```shell

start container

docker run -d --rm \ -e PASSWORD=pass1234 \ -v "$(pwd):$(pwd)" \ -w "$(pwd)" \ -p 2022:2022 \ "build-runner:edge"

connect

sshpass -p "pass1234" ssh \ -o StrictHostKeyChecking=no \ -o UserKnownHostsFile=/dev/null \ -o LogLevel=ERROR \ -p 2022 \ "runner@localhost" \ id ```

See configuration to set the public key or password during build time.

Configuration

This image can be configured using the following options of which all but APP_USER and APP_GROUP exist as both—build argument and environment variable.
You should go for build arguments if you want to set custom defaults you don't intend to change (often). Environment variables will overrule any existing configuration on each container start.

  • APP_USER Name of the main user (default: runner)
  • APP_GROUP Name of the main user's group (default: runner)
  • DEBUG Whether to log debug information (default: 0)
  • TZ Timezone the container runs in (default: UTC)
  • LANG Language/locale to use (default: C.UTF-8)
  • PUID User ID of the runner user (default: 1000)
  • PGID Group ID of the runner group (default: 1000)
  • AUTHORIZED_KEYS Public key(s) that can be used to log in via SSH as runner
  • PASSWORD Password of runner (default: runner)

🔐 Specifying authorized key(s) will automatically disable password-based authentication. An eventually also configured password will be ignored.
Setting authorized key(s) to an empty string, will re-enable the password-based authentication with either the provided or otherwise a randomly generated password.

```shell

Build single image with build argument AUTHORIZED_KEYS

docker buildx bake --set "*.args.AUTHORIZEDKEYS=$(cat ~/.ssh/idrsa.pub)"

Build multi-platform image with build argument AUTHORIZED_KEYS

docker buildx bake image-all --set "*.args.AUTHORIZEDKEYS=$(cat ~/.ssh/idrsa.pub)"

Start container with environment variable AUTHORIZED_KEYS

docker run --rm \ -e AUTHORIZEDKEYS="$(cat ~/.ssh/idrsa.pub)" \ -v "$(pwd):$(pwd)" \ -w "$(pwd)" \ -p 2022:2022 \ build-runner:local ```

Testing

```shell git clone https://github.com/bkahlert/build-runner.git cd build-runner

Use Bats wrapper to run tests

curl -LfsS https://git.io/batsw \ | DOCKERBAKE="--set '*.tags=test'" "$SHELL" -s -- --batsw:-e --batsw:BUILDTAG=test test ```

Bats Wrapper is a self-contained wrapper to run tests based on the Bash testing framework Bats.

💡 To accelerate testing, the Bats Wrapper checks if any test is prefixed with a capital X and if so, only runs those tests.

Troubleshooting

  • To avoid permission problems with generated files, you can use your local user/group ID (see PUID/PGID).
  • If you need access to Docker, its command line interface is already installed.
    You can control your host instance by mounting /var/run/docker.sock.

shell docker run -it --rm \ -e PUID="$(id -u)" \ -e PGID="$(id -g)" \ -v /var/run/docker.sock:/var/run/docker.sock \ -v "$PWD":"$PWD" \ -w "$PWD" \ bkahlert/build-runner:edge

Contributing

Want to contribute? Awesome! The most basic way to show your support is to star the project, or to raise issues. You can also support this project by making a PayPal donation to ensure this journey continues indefinitely!

Thanks again for your support, it is much appreciated! :pray:

License

MIT. See LICENSE for more details.

Owner

  • Name: Björn Kahlert
  • Login: bkahlert
  • Kind: user
  • Location: Berlin, Germany

GitHub Events

Total
Last Year

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 32
  • Total Committers: 2
  • Avg Commits per committer: 16.0
  • Development Distribution Score (DDS): 0.031
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Björn Kahlert m****l@b****m 31
dependabot[bot] 4****] 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 0
  • Total pull requests: 16
  • Average time to close issues: N/A
  • Average time to close pull requests: 2 months
  • Total issue authors: 0
  • Total pull request authors: 3
  • Average comments per issue: 0
  • Average comments per pull request: 0.44
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 15
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (13)
  • github-actions[bot] (2)
  • bkahlert (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (13) github_actions (9) docker (4) recordr (2) docs (2) rec (2)

Dependencies

.github/workflows/build.yml actions
  • actions/checkout v2 composite
  • actions/upload-artifact v2 composite
  • bkahlert/bats-wrapper v0.1.4 composite
  • docker/bake-action v1 composite
  • docker/login-action v1 composite
  • docker/metadata-action v3 composite
  • docker/setup-buildx-action v1 composite
  • docker/setup-qemu-action v1 composite
  • softprops/action-gh-release v1 composite
.github/workflows/docs.yml actions
  • actions/checkout v2 composite
  • actions/upload-artifact v2 composite
  • bkahlert/recordr v0.2.2 composite
  • peter-evans/create-pull-request v3 composite
.github/workflows/test-report.yml actions
  • dorny/test-reporter v1 composite
Dockerfile docker
  • docker 20.10.12-alpine3.14 build