Skip to content

Commit

Permalink
chore: README updates with GHCR image name, SECURITY policy
Browse files Browse the repository at this point in the history
  • Loading branch information
whisperity committed May 22, 2024
1 parent e64523b commit 06ab486
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 8 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.github
LICENSE
README.md
SECURITY.md
40 changes: 33 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,71 @@
[DistCC](http://distcc.org) Docker (LTS)
========================================
[DistCC](http://distcc.org) Docker
==================================

This project provides support for executing a [DistCC](http://distcc.org) worker in a [Docker](http://docker.com) environment, supporting all major compilers' every accessible LTS-available version on the platform.
Put simply, this allows using a single DistCC environment, using, e.g., an Ubuntu 20.04 base image, to run the major compilers available under Ubuntu 20.04, 22.04, and 24.04 LTSes simultaneously.



Usage
-----

The easiest way to obtain a running container with the default and suggested configuration is by calling `docker compose up` for the provided [`docker-compose.yml`](/docker-compose.yml) file.


```bash
docker-compose up --detach
```


For **Ubuntu 20.04 "Focal Fossa" LTS** host computers, it is very likely that a newer version of _Docker Compose_ is needed first:


```bash
wget http://github.com/docker/compose/releases/download/v2.27.0/docker-compose-linux-x86_64
sudo mv ./docker-compose-linux_x86_64 /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
```



### Downloading or building the image

You can build the image yourself locally:
The image is available in the [GitHub Container Registry](http://ghcr.io) under [`whisperity/distcc-docker`](http://github.com/whisperity/distcc-docker/pkgs/container/distcc-docker).

Alternatively, you can build the image yourself locally:


```bash
docker build \
--tag distcc-service:latest \
--tag distcc-docker:latest \
.
```


By default, the building of the image will install the necessary and available compiler versions for best support.
In case a smaller image is deemed necessary, pass `--build-arg="LAZY_COMPILERS=1"`.
The resulting image will install the curated list of compilers **at the first start** of the container, without occupying space in the _image_.
However, this will increase the network use and the initial deployment time of the containers.



### Setting up the workers

You can start the container manually, with the following arguments.
Alternatively, you can start the container manually, with the following arguments.
The running container will act as the master DistCC daemon of the host computer, listening on the _default_ ports `3632` and `3633`.


```bash
docker run \
--detach \
--detach \
--init \
--publish 3632:3632/tcp \
--publish 3633:3633/tcp \
--restart unless-stopped \
--mount type=tmpfs,destination=/tmp,tmpfs-mode=1770,tmpfs-size=8G \
<IMAGE NAME???>
ghcr.io/whisperity/distcc-docker:ubuntu-20.04
```


The number of worker threads available for the service can be configured by passing `--jobs N` after the image name, directly to the container's _"`main()`"_ script.
The suggested _default_ is the number of CPU threads available on the machine, minus 2.
17 changes: 17 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Security Policy for the _DistCC Docker_ project
===============================================

Supported versions
------------------

Due to its somewhat trivial nature, this project does not ship with the concepts of "versions".
Only the latest built image, as available from the `master` branch, is considered "supported".


Private vulnerability reporting
-------------------------------

Please use [GitHub's security advisory](http://github.com/whisperity/distcc-docker/security/advisories/new) system associated with the repository to report a security issue with the project.
This ensures that the incident is given appropriate tracking, allows for controlled communication, and responsible disclosure.

For issues that do not affect user or system security, create a [normal issue](http://github.com/whisperity/distcc-docker/issues/new) instead!
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "distcc"

services:
distcc:
image: "ghcr.io/whisperity/distcc-docker:ubuntu-20.04"
init: true
restart: "unless-stopped"
ports:
- "3632:3632/tcp"
- "3633:3633/tcp"
volumes:
- type: tmpfs
target: "/tmp"
tmpfs:
mode: 1770
size: "8G"
# Specify
# command: >
# --jobs N
# to alter the number of workers available in the service.
2 changes: 1 addition & 1 deletion usr/local/sbin/container-main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ function custom_command() {
# Entry point.
_syslog "_" $$ "Initialising..."
EXIT_CODE=0
echo "[>>>] DistCC LTS Docker worker container initialising..." >&2
echo "[>>>] DistCC Docker worker container initialising..." >&2
_check_init

_check_and_install_compilers
Expand Down

0 comments on commit 06ab486

Please sign in to comment.