diff --git a/bin/build b/bin/build index 13f438e..ba9b3ef 100644 --- a/bin/build +++ b/bin/build @@ -1 +1,19 @@ -make -f $DOCKER_HOME/images/$1.mk build +FILE=$DOCKER_HOME/images/$1.mk +echo $FILE +if [[ ! -e $FILE ]]; then + DELETE=true + FILE="$(mktemp)" + echo 123 + cat <<- EOF > $FILE + include \$(DOCKER_HOME)/build/Makefile + + NAME = $1 + VERSION = latest + + build: $1 +EOF +fi +make -f $FILE build +if [ ! -z ${DELETE+x} ]; then + rm $FILE +fi \ No newline at end of file diff --git a/build/Makefile b/build/Makefile index b679e0e..924b4c5 100644 --- a/build/Makefile +++ b/build/Makefile @@ -38,17 +38,16 @@ endef all: build bin service clean build: prepare base - $(call script,cleanup) @echo 'RUN chmod +x /opt/init.d/*' >> ${FILE} @echo 'CMD ["/opt/init"]' >> ${FILE} + @echo ENV MODE $(MODE) >> ${FILE} + $(call script,cleanup) @docker build -t $(NAME):$(VERSION) $(ARGS) ${BASE} prepare: @echo FROM $(FROM) > ${FILE} - @echo ENV MODE $(MODE) >> ${FILE} $(call add,config,/build/config) $(call add,init,/opt/init) - @echo 'RUN chmod +x /opt/init' >> ${FILE} $(call script,prepare) clean: diff --git a/images/automysqlbackup.mk b/images/automysqlbackup.mk deleted file mode 100644 index 2e31983..0000000 --- a/images/automysqlbackup.mk +++ /dev/null @@ -1,6 +0,0 @@ -include $(DOCKER_HOME)/build/Makefile - -NAME = automysqlbackup -VERSION = latest - -build: automysqlbackup \ No newline at end of file diff --git a/images/backintime.mk b/images/backintime.mk deleted file mode 100644 index a1c546d..0000000 --- a/images/backintime.mk +++ /dev/null @@ -1,6 +0,0 @@ -include $(DOCKER_HOME)/build/Makefile - -NAME = backintime -VERSION = latest - -build: backintime \ No newline at end of file diff --git a/images/base.mk b/images/base.mk deleted file mode 100644 index 4338344..0000000 --- a/images/base.mk +++ /dev/null @@ -1,6 +0,0 @@ -include $(DOCKER_HOME)/build/Makefile - -NAME = base -VERSION = latest - -build: base \ No newline at end of file diff --git a/images/btsync.mk b/images/btsync.mk deleted file mode 100644 index 46ce801..0000000 --- a/images/btsync.mk +++ /dev/null @@ -1,6 +0,0 @@ -include $(DOCKER_HOME)/build/Makefile - -NAME = btsync -VERSION = latest - -build: btsync \ No newline at end of file diff --git a/images/couchpotato.mk b/images/couchpotato.mk deleted file mode 100644 index d54a79e..0000000 --- a/images/couchpotato.mk +++ /dev/null @@ -1,6 +0,0 @@ -include $(DOCKER_HOME)/build/Makefile - -NAME = couchpotato -VERSION = latest - -build: couchpotato \ No newline at end of file diff --git a/images/ftp.mk b/images/ftp.mk deleted file mode 100644 index 5993c4c..0000000 --- a/images/ftp.mk +++ /dev/null @@ -1,6 +0,0 @@ -include $(DOCKER_HOME)/build/Makefile - -NAME = ftp -VERSION = latest - -build: ftp diff --git a/images/hamachi.mk b/images/hamachi.mk deleted file mode 100644 index cfa9ef9..0000000 --- a/images/hamachi.mk +++ /dev/null @@ -1,6 +0,0 @@ -include $(DOCKER_HOME)/build/Makefile - -NAME = hamachi -VERSION = latest - -build: hamachi \ No newline at end of file diff --git a/images/headphones.mk b/images/headphones.mk deleted file mode 100644 index 884efa4..0000000 --- a/images/headphones.mk +++ /dev/null @@ -1,6 +0,0 @@ -include $(DOCKER_HOME)/build/Makefile - -NAME = headphones -VERSION = latest - -build: headphones \ No newline at end of file diff --git a/images/mysql.mk b/images/mysql.mk deleted file mode 100644 index e98baec..0000000 --- a/images/mysql.mk +++ /dev/null @@ -1,6 +0,0 @@ -include $(DOCKER_HOME)/build/Makefile - -NAME = mysql -VERSION = latest - -build: mysql \ No newline at end of file diff --git a/images/redis.mk b/images/redis.mk deleted file mode 100644 index c7cbb28..0000000 --- a/images/redis.mk +++ /dev/null @@ -1,6 +0,0 @@ -include $(DOCKER_HOME)/build/Makefile - -NAME = redis -VERSION = latest - -build: redis \ No newline at end of file diff --git a/images/sabnzbd.mk b/images/sabnzbd.mk deleted file mode 100644 index 0adbc7a..0000000 --- a/images/sabnzbd.mk +++ /dev/null @@ -1,6 +0,0 @@ -include $(DOCKER_HOME)/build/Makefile - -NAME = sabnzbd -VERSION = latest - -build: sabnzbd \ No newline at end of file diff --git a/images/sickbeard.mk b/images/sickbeard.mk deleted file mode 100644 index b305fbe..0000000 --- a/images/sickbeard.mk +++ /dev/null @@ -1,6 +0,0 @@ -include $(DOCKER_HOME)/build/Makefile - -NAME = sickbeard -VERSION = latest - -build: sickbeard \ No newline at end of file diff --git a/images/sonarr.mk b/images/sonarr.mk deleted file mode 100644 index 54eb99f..0000000 --- a/images/sonarr.mk +++ /dev/null @@ -1,6 +0,0 @@ -include $(DOCKER_HOME)/build/Makefile - -NAME = sonarr -VERSION = latest - -build: sonarr \ No newline at end of file diff --git a/images/testing.mk b/images/testing.mk deleted file mode 100644 index 6496919..0000000 --- a/images/testing.mk +++ /dev/null @@ -1,6 +0,0 @@ -include $(DOCKER_HOME)/build/Makefile - -NAME = testing -VERSION = latest - -build: testing \ No newline at end of file diff --git a/images/transmission.mk b/images/transmission.mk deleted file mode 100644 index 8e35d81..0000000 --- a/images/transmission.mk +++ /dev/null @@ -1,6 +0,0 @@ -include $(DOCKER_HOME)/build/Makefile - -NAME = transmission -VERSION = latest - -build: transmission \ No newline at end of file