Skip to content

Instantly share code, notes, and snippets.

@bvk
Created March 13, 2016 05:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bvk/28c0243016df9a57778f to your computer and use it in GitHub Desktop.
Save bvk/28c0243016df9a57778f to your computer and use it in GitHub Desktop.
Docker builds using GNU Autotools build system
#
# Save these rules in GNUmakefile in the configure.ac file directory.
#
# If user doesn't specify anything, pick a default docker image.
DOCKER_IMAGE ?= builder-ubuntu
# Bind mounts when running the docker image. Users can add more by defining
# DOCKER_BIND_OPTS in the command-line.
override DOCKER_BIND_OPTS += -v /home:/home
override DOCKER_BIND_OPTS += -v /etc/passwd:/etc/passwd
override DOCKER_BIND_OPTS += -v /etc/group:/etc/group
override DOCKER_BIND_OPTS += -v /etc/shadow:/etc/shadow
%:
ifndef DOCKER
docker run -t $(DOCKER_BIND_OPTS) $(DOCKER_IMAGE) sudo -u $(USER) \
$(MAKE) DOCKER=1 TERM=dumb -C $(CURDIR) $@
else
$(MAKE) -f Makefile $@
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment