-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added preliminary Dockerfile and tooling #2
Draft
InnovativeInventor
wants to merge
2
commits into
ungoogled-software:master
Choose a base branch
from
InnovativeInventor:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## Docker + ungoogled_chromium builds | ||
|
||
This folder is intended to contain scripts, Dockerfiles, and other misc. files to assist in the creation of reproducible builds. | ||
To that end, all Dockerfiles are pinned to a particular Debian version (it's a best practice anyways) and everything is, if possible, specified by hash. | ||
A reproducible environment is the first step towards reproducible builds. | ||
Each separate platform will be in a different folder (e.g. [`./debian/`](/docker/debian)). | ||
|
||
## Building on a VPS | ||
To aid in the ease of reproducing (the easier it is to reproduce or build, the more people will do it), some simple scripts have been added to setup and teardown a VPS instance. | ||
Right now, the scripts are only written for DigitalOcean, but contributions are welcome! | ||
|
||
### DigitalOcean setup | ||
Deps: | ||
|
||
- [doctl](https://github.com/digitalocean/doctl) | ||
|
||
To setup a VPS instance on DigitalOcean, run: | ||
``` | ||
bash do-setup.sh [ssh-key] | ||
``` | ||
where `[ssh-key]` is the id of one of your DigitalOcean ssh keys (you can list them by running `doctl compute ssh-key list`) | ||
|
||
To teardown, execute: | ||
``` | ||
bash do-teardown.sh | ||
``` | ||
|
||
## Contributions | ||
Just follow the same format as above. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Here we make sure to specify the digest to prevent tampering and ensure reproducibility | ||
# This is from https://hub.docker.com/layers/debian/library/debian/buster-slim/images/sha256-e0a33348ac8cace6b4294885e6e0bb57ecdfe4b6e415f1a7f4c5da5fe3116e02?context=explore | ||
|
||
FROM debian@sha256:e0a33348ac8cace6b4294885e6e0bb57ecdfe4b6e415f1a7f4c5da5fe3116e02 | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
# The following lines have been modified from the README | ||
RUN apt-get update && apt-get install -y git python3 packaging-dev equivs | ||
|
||
RUN git clone --recurse-submodules https://github.com/ungoogled-software/ungoogled-chromium-debian.git | ||
|
||
# Checkout to commit: https://github.com/ungoogled-software/ungoogled-chromium-debian/commit/1c1b44277f7b0c88fc510394e25ec9d1d0dfcb7a | ||
RUN git -C ungoogled-chromium-debian checkout --recurse-submodules 1c1b44277f7b0c88fc510394e25ec9d1d0dfcb7a && mkdir -p build/src && cp -r ungoogled-chromium-debian/debian build/src/ | ||
|
||
# From: https://superuser.com/questions/164553/automatically-answer-yes-when-using-apt-get-install | ||
RUN echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf.d/forceyes | ||
RUN echo 'APT::Get::force-yes "true";' >> /etc/apt/apt.conf.d/forceyes | ||
|
||
# The rest of the Dockerfile is modified from the README | ||
RUN cd build/src && ./debian/scripts/setup debian && mk-build-deps -i debian/control | ||
|
||
# RUN rm ungoogled-chromium-build-deps_* | ||
|
||
RUN cd build/src && ./debian/scripts/setup local-src | ||
|
||
RUN cd build/src && dpkg-buildpackage -b -uc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Helper to setup a digitalocean VPS with all the right stuff | ||
# Usage: bash do-setup.sh [ssh-key-id] | ||
# If you do not specify ssh-key-id, you need to know the root password! | ||
|
||
# Example: bash do-setup.sh 28142601 | ||
|
||
if [ -z "$1" ]; then | ||
doctl compute droplet create "ungoogled-chromium" --image ubuntu-20-04-x64 --region nyc1 --size s-6vcpu-16gb | ||
else | ||
doctl compute droplet create "ungoogled-chromium" --image ubuntu-20-04-x64 --region nyc1 --size s-6vcpu-16gb --ssh-keys $1 | ||
fi | ||
|
||
echo "curl -fsSL https://get.docker.com -o get-docker.sh" | doctl compute ssh "ungoogled-chromium" | ||
echo "sh get-docker.sh" | doctl compute ssh "ungoogled-chromium" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Helper to destroy a digitalocean VPS that was created with do-setup.sh | ||
# Usage: bash do-teardown.sh | ||
|
||
doctl compute droplet delete "ungoogled-chromium" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary to have a Layout section, because anyone can contribute anything to contrib at any point. Too much structure makes things difficult, and we should minimize difficulty.
It should be sufficient to simply have a
README.md
inside your docker directory, as users should find that on their own without any indication.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point! Does a
/scripts/builds
thing work or were you thinking of something else?I'll put a thing in the README about all the scripts being in
/scripts
if you think that's best -- if not, I'll remove the layout section entirely.Reproducible builds is one of the main goals of having a Dockerfile build process, but it isn't the only main goal -- it's also great if users want to build it themselves (all they need to do is build the Dockefile). I'm thinking about perhaps adding Dockerfiles for other architectures/OSes before I get reproducible builds working.
Lmk what you think -- I'm not particularly attached to any of the above ideas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a directory like
reproducible-debian
? If we want to add more code regarding reproducibility in the future, then we could move your code intoreproducible-debian/docker
.Docker is pretty useful, but I don't agree with your premise (i.e. easier for users to build it themselves) for a few nitpicky reasons:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've used Docker on both Debian and macOS to build UC so here are my opinions:
Docker on macOS is possible, but very inefficient since it needs a VM to run. Meanwhile if you do not have UI access to the mac machine you cannot use VirtualBox due to a copyright/license problem I think, and the other VM is old and not well maintained.
If the user uses a remote machine for building, than Docker can potentially be a necessary tool. There exists a lot of cloud solutions based on Docker so I believe it is not much riskier than, say running a LAMP stack. The reason I used Docker is there are often a lot of restrictions on remote machines, for example:
In these cases, Docker is basically the only way to get a working environment.
I think a reasonable point is that, Docker and Dockerfile can be useful for those who need it, and it can potentially be more friendly to users who want to make small changes to the project. IMO the problem it solves better is a quick to establish development/build environment, reproducibility is a nice addon.