Skip to content

Commit 4ec2fef

Browse files
committed
README.md: simplify local usage of nix/docker for devs/local images builders(local repro of CircleCI builds), referring to ./docker_*.sh scripts created
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
1 parent e70e2f7 commit 4ec2fef

1 file changed

Lines changed: 16 additions & 12 deletions

File tree

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ Build docker from nix develop layer locally
5555

5656
#### Build image
5757

58+
* Have docker and Nix installed
59+
5860
* Build nix developer local environment with flakes locked to specified versions
59-
* `nix --print-build-logs --verbose develop --ignore-environment --command true`
60-
* Build docker image with current develop created environment (this will take a while and create "linuxboot/heads:dev-env" local docker image):
61-
* `nix --print-build-logs --verbose build .#dockerImage && docker load < result`
61+
* `./docker_local_dev.sh`
6262

6363
On some hardened OSes, you may encounter problems with ptrace.
6464
```
@@ -75,12 +75,16 @@ sudo sysctl -w kernel.yama.ptrace_scope=1 #setup the value to let nix+docker run
7575

7676
Done!
7777

78-
Your local docker image "linuxboot/heads:dev-env" is ready to use, reproducible for the specific Heads commit used and will produce ROMs reproducible for that Heads commit ID.
78+
Your local docker image "linuxboot/heads:dev-env" is ready to use, reproducible for the specific Heads commit used to build it, and will produce ROMs reproducible for that Heads commit ID.
7979

8080
Jump into nix develop created docker image for interactive workflow
8181
====
82-
`docker run -e DISPLAY=$DISPLAY --network host --rm -ti -v $(pwd):$(pwd) -w $(pwd) linuxboot/heads:dev-env`
82+
There is 3 helpers:
83+
- `./docker_local_dev.sh`: for developers wanting to customize docker image built from flake.nix(nix devenv creation) and flake.lock (pinned versions used by flake.nix)
84+
- `./docker_latest.sh`: for Heads developers, wanting to use latest published docker images to develop Heads
85+
- `./docker_repro.sh`: versioned docker image used under CircleCI to produce reproducivle builds, both locally and under CircleCI. **Use this one if in doubt**
8386

87+
ie: `./docker_repro.sh` will jump into CircleCI used versioned docker image for that Heads commit id to build images reproducibly if git repo is clean (not dirty).
8488

8589
From there you can use the docker image interactively.
8690

@@ -92,22 +96,22 @@ Please refer to [qemu documentation](targets/qemu.md) for more information.
9296

9397
Eg:
9498
```
95-
make BOARD=qemu-coreboot-fbwhiptail-tpm2 # Build rom, export public key to emulated usb storage from qemu runtime
96-
make BOARD=qemu-coreboot-fbwhiptail-tpm2 PUBKEY_ASC=~/pubkey.asc inject_gpg # Inject pubkey into rom image
97-
make BOARD=qemu-coreboot-fbwhiptail-tpm2 USB_TOKEN=Nitrokey3NFC PUBKEY_ASC=~/pubkey.asc ROOT_DISK_IMG=~/qemu-disks/debian-9.cow2 INSTALL_IMG=~/Downloads/debian-9.13.0-amd64-xfce-CD-1.iso run # Install
99+
./docker_repro.sh make BOARD=qemu-coreboot-fbwhiptail-tpm2 # Build rom, export public key to emulated usb storage from qemu runtime
100+
./docker_repro.sh make BOARD=qemu-coreboot-fbwhiptail-tpm2 PUBKEY_ASC=~/pubkey.asc inject_gpg # Inject pubkey into rom image
101+
./docker_repro.sh make BOARD=qemu-coreboot-fbwhiptail-tpm2 USB_TOKEN=Nitrokey3NFC PUBKEY_ASC=~/pubkey.asc ROOT_DISK_IMG=~/qemu-disks/debian-9.cow2 INSTALL_IMG=~/Downloads/debian-9.13.0-amd64-xfce-CD-1.iso run # Install
98102
```
99103

100-
Alternatively, you can use locally built docker image to build a board ROM image in a single call.
104+
Alternatively, you can use locally built docker image to build a board ROM image in a single call **but do not expect reproducible builds if not using versioned docker images as per CircleCI as per usage of `./docker_repro.sh`**
101105

102106
Eg:
103-
`docker run -e DISPLAY=$DISPLAY --network host --rm -ti -v $(pwd):$(pwd) -w $(pwd) linuxboot/heads:dev-env -- make BOARD=nitropad-nv41`
107+
`./docker_local_dev.sh make BOARD=nitropad-nv41`
104108

105109

106110
Pull docker hub image to prepare reproducible ROMs as CircleCI in one call
107111
====
108112
```
109-
docker run -e DISPLAY=$DISPLAY --network host --rm -ti -v $(pwd):$(pwd) -w $(pwd) tlaurion/heads-dev-env:latest -- make BOARD=x230-hotp-maximized
110-
docker run -e DISPLAY=$DISPLAY --network host --rm -ti -v $(pwd):$(pwd) -w $(pwd) tlaurion/heads-dev-env:latest -- make BOARD=nitropad-nv41
113+
./docker_repro.sh make BOARD=x230-hotp-maximized
114+
./docker_repro.sh make BOARD=nitropad-nv41
111115
```
112116

113117
Maintenance notes on docker image

0 commit comments

Comments
 (0)