erigon-pulse/hooks/build
Cory 74cf9840ae
Patch plumbing of docker-compose UID/GID build args (#4527)
* Patch plumbing of docker-compose UID/GID build args

* Fallback to 1000/1000 if DOCKER_(U|G)ID not set

* Revise README.md instructions for docker further

* Fix existing typo forc 'servie' -> 'service'

* Rename PUID/GUID -> UID/GID

* Specify user in erigon docker service

* Rely on .env instead of specifying :-1000

* Polish Makefile for docker use case

* one more helpful comment

* make docker should use UID/GID --build-arg

* Fix make docker and more fail-fast if envvar set incorrect

* mv .env->.env.example to not intefere existing workflows

* Specify envvars in docker CI

* Adjust validate_docker_build_args to permit non-erigon user

* Also run docker CI target on macos-11 os

* Add DOCKER_UID, DOCKER_GID in hooks/build

* Patch docker build arg validation for macos

* Add actions-setup-docker@master for macos

* Don't run automated test for docker macos

* Cleanup Makefile

* Comments, targets for erigon users

* More Makefile cleanup, debugging still

* Typo fix

* Create subdirs before calling ls

* Get rid of flaky validation

* DOCKER_UID, DOCKER_GID init to runner if not set

* Get rid of unnecessary variable for now

* Improved README based on new changes

* Proper uid/gid `make user_*` when no envars set

* Fix typo in Makefile comment

* Fix make docker as sudo user
2022-06-30 16:11:37 +06:00

19 lines
536 B
Bash
Executable File

#!/bin/bash
# This is needed to pass build ARGs to Dockerfile.
# see https://docs.docker.com/docker-hub/builds/advanced/
set -o errexit # exit on error
set -o nounset # disallow unset variables
set -o pipefail # fail if anything in pipe fails
# $(id -u) and $(id -g) will be 0
#
# so we need to specify the erigon user uid/gid in the image
# choose 3473 matching defaults in .env.example
DOCKER_FLAGS="-t ${IMAGE_NAME}" \
DOCKER_UID=3473 \
DOCKER_GID=3473 \
GIT_TAG=$(git describe --tags '--match=v*' --dirty) \
make docker