mirror of
https://forge.fsky.io/oneflux/omegafox.git
synced 2026-02-10 07:02:03 -08:00
Dockerfile: Allow use of local ~/.mozbuild, etc.
This commit is contained in:
parent
75bf5f3c0a
commit
e899a38690
3 changed files with 49 additions and 26 deletions
23
Dockerfile
23
Dockerfile
|
|
@ -2,18 +2,25 @@ FROM ubuntu:latest
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy the current directory contents into the container at /app
|
# Copy the current directory into the container at /app
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
|
||||||
# Install necessary packages
|
# Install necessary packages
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
# Makefile utils
|
# Makefile utils
|
||||||
build-essential make git msitools wget unzip \
|
build-essential make git msitools wget unzip \
|
||||||
# Python
|
# Python
|
||||||
python3 python3-dev python3-pip \
|
python3 python3-dev python3-pip \
|
||||||
# Camoufox build system utils
|
# Camoufox build system utils
|
||||||
p7zip-full golang-go
|
p7zip-full golang-go
|
||||||
|
|
||||||
RUN make fetch && make mozbootstrap
|
# Fetch Firefox & apply initial patches
|
||||||
|
RUN make fetch && \
|
||||||
|
make mozbootstrap && \
|
||||||
|
mkdir /app/dist
|
||||||
|
|
||||||
ENTRYPOINT ["python3", "./multibuild.py"]
|
# Mount .mozbuild directory and dist folder
|
||||||
|
VOLUME /root/.mozbuild
|
||||||
|
VOLUME /app/dist
|
||||||
|
|
||||||
|
ENTRYPOINT ["python3", "./multibuild.py"]
|
||||||
47
README.md
47
README.md
|
|
@ -345,15 +345,7 @@ docker build -t camoufox-builder .
|
||||||
2. Build Camoufox patches to a target platform and architecture:
|
2. Build Camoufox patches to a target platform and architecture:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run camoufox-builder --target <os> --arch <arch>
|
docker run -v "$(pwd)/dist:/app/dist" camoufox-builder --target <os> --arch <arch>
|
||||||
# Asset files will be printed at the end
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Download zip file assets:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker ps # Find container ID
|
|
||||||
docker cp <container id>:/app/<asset>.zip .
|
|
||||||
```
|
```
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
|
|
@ -362,7 +354,7 @@ CLI Parameters
|
||||||
</summary>
|
</summary>
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
options:
|
Options:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
--target {linux,windows,macos}
|
--target {linux,windows,macos}
|
||||||
Target platform for the build
|
Target platform for the build
|
||||||
|
|
@ -372,6 +364,27 @@ options:
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>
|
||||||
|
How can I use my local ~/.mozbuild directory?
|
||||||
|
</summary>
|
||||||
|
|
||||||
|
If you want to use the host's .mozbuild directory, you can use the following command instead to run the docker:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run \
|
||||||
|
-v "$HOME/.mozbuild":/root/.mozbuild:rw,z \
|
||||||
|
-v "$(pwd)/dist:/app/dist" \
|
||||||
|
camoufox-builder \
|
||||||
|
--target <os> \
|
||||||
|
--arch <arch>
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
Build artifacts will now appear written under the `dist/` folder.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
@ -393,16 +406,18 @@ To use, select "Reset workspace", make changes in the camoufox-\*/ folder, then
|
||||||
|
|
||||||
### How to work on an existing patch
|
### How to work on an existing patch
|
||||||
|
|
||||||
In the developer UI, reset your workspace, then select "Select patches" and select all **but** the one you want to edit.
|
1. In the developer UI, reset your workspace.
|
||||||
|
2. Then, click "Select patches", and select all **but** the one you want to edit.
|
||||||
Then, in the camoufox-\*/ folder, create a new commit:
|
3. Create a checkpoint. This will commit the current workspace to the local repo:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git commit -m "Base commit" -a
|
make checkpoint
|
||||||
```
|
```
|
||||||
|
|
||||||
Then in the developer UI, hit "Select patches" and apply the patch you would like to edit.
|
4. In the developer UI, click "Select patches", and _apply_ the patch you would like to edit.
|
||||||
|
|
||||||
After you're done editing, hit "Write workspace to patch", and overwrite the existing patch.
|
Make your changes. Test builds can be made with `make build` and `make run`.
|
||||||
|
|
||||||
|
5. After you're done editing, hit "Write workspace to patch", and overwrite the existing patch.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -78,8 +78,9 @@ def main():
|
||||||
builder.build()
|
builder.build()
|
||||||
# Run package
|
# Run package
|
||||||
builder.package()
|
builder.package()
|
||||||
# Print assets
|
# Move assets to dist
|
||||||
print(builder.assets)
|
for asset in builder.assets:
|
||||||
|
os.rename(asset, f'dist/{asset}')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue