Skip to content

Commit 1dfd491

Browse files
Clean way of setting UID and GID.
1 parent 945f3ee commit 1dfd491

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

espresso/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
services:
44
l1-genesis:
5-
user: 1000:1000
5+
user: ${U_ID}:${GID}
66
restart: on-failure
77
build:
88
context: ../
@@ -122,7 +122,7 @@ services:
122122
- ./deployment/deployer:/deployer:ro
123123

124124
l2-genesis:
125-
user: 1000:1000
125+
user: "${U_ID}:${GID}"
126126
restart: on-failure
127127
build:
128128
context: ../

justfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Variable
2+
gid := `id -g`
3+
uid := `id -u`
4+
15
# Run the tests
26
tests:
37
./run_all_tests.sh
@@ -6,12 +10,12 @@ fast-tests:
610
./run_fast_tests.sh
711

812
devnet-tests: build-devnet
9-
go test -timeout 30m -p 1 -count 1 -skip 'TestRotateBatcherKey|TestChangeBatchInboxOwner' -v ./espresso/devnet-tests/...
13+
U_ID={{uid}} GID={{gid}} go test -timeout 30m -p 1 -count 1 -skip 'TestRotateBatcherKey|TestChangeBatchInboxOwner' -v ./espresso/devnet-tests/...
1014

1115
build-devnet: compile-contracts
1216
rm -Rf espresso/deployment
1317
(cd op-deployer && just)
14-
(cd espresso && ./scripts/prepare-allocs.sh && docker compose build)
18+
(cd espresso && U_ID={{uid}} GID={{gid}} ./scripts/prepare-allocs.sh && docker compose build)
1519

1620
golint:
1721
golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint --timeout 5m -e "errors.As" -e "errors.Is" ./...
@@ -65,7 +69,7 @@ nuke:
6569

6670
# Stop the containers
6771
stop-containers:
68-
(cd espresso && docker compose down -v)
72+
(cd espresso && U_ID={{uid}} GID={{gid}} docker compose down -v)
6973

7074
# Checks that TODO comments have corresponding issues.
7175
todo-checker:

0 commit comments

Comments
 (0)