Created
March 13, 2016 05:13
-
-
Save bvk/28c0243016df9a57778f to your computer and use it in GitHub Desktop.
Docker builds using GNU Autotools build system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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