mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2024-11-23 03:21:28 +01:00
update dockerfile
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
parent
7b5ef7166f
commit
43fab0cce2
19
Makefile
19
Makefile
|
@ -1,17 +1,30 @@
|
|||
.PHONY: build
|
||||
build: ## Builds all the dockerfiles in the repository.
|
||||
./build-all.sh
|
||||
@$(CURDIR)/build-all.sh
|
||||
|
||||
.PHONY: latest-versions
|
||||
latest-versions: ## Checks all the latest versions of the Dockerfile contents.
|
||||
./latest-versions.sh
|
||||
@$(CURDIR)/latest-versions.sh
|
||||
|
||||
check_defined = \
|
||||
$(strip $(foreach 1,$1, \
|
||||
$(call __check_defined,$1,$(strip $(value 2)))))
|
||||
__check_defined = \
|
||||
$(if $(value $1),, \
|
||||
$(error Undefined $1$(if $2, ($2))$(if $(value @), \
|
||||
required by target `$@')))
|
||||
|
||||
.PHONY: run
|
||||
run: ## Run a Dockerfile from the command at the top of the file (ex. DIR=telnet).
|
||||
@:$(call check_defined, DIR, directory of the Dockefile)
|
||||
@$(CURDIR)/run.sh "$(DIR)"
|
||||
|
||||
.PHONY: test
|
||||
test: shellcheck dockerfiles ## Runs the tests on the repository.
|
||||
|
||||
.PHONY: dockerfiles
|
||||
dockerfiles: ## Tests the changes to the Dockefiles build.
|
||||
./test.sh
|
||||
@$(CURDIR)/test.sh
|
||||
|
||||
# if this session isn't interactive, then we don't want to allocate a
|
||||
# TTY, which would fail, but if it is interactive, we do want to attach
|
||||
|
|
19
run.sh
19
run.sh
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
#
|
||||
# This script allows you to launch several images
|
||||
# from this repository once they're built.
|
||||
|
@ -8,29 +8,32 @@
|
|||
# can find it and execute it.
|
||||
#
|
||||
# Use pulseaudio/Dockerfile and skype/Dockerfile as examples.
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
if [[ $# -eq 0 ]]; then
|
||||
echo "Usage: $0 [--test] image1 image2 ..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$1" = "--test" ]; then
|
||||
if [[ "$1" = "--test" ]]; then
|
||||
TEST=1
|
||||
shift
|
||||
fi
|
||||
|
||||
for name in "$@"; do
|
||||
if [ ! -d $name ]; then
|
||||
echo "unable to find container configuration with name $name"
|
||||
if [[ ! -d "$name" ]]; then
|
||||
echo "Unable to find container configuration with name: $name"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
script=`sed -n '/docker run/,/^#$/p' $name/Dockerfile | head -n -1 | sed -e 's/\#//' | sed -e 's/\\\//'`
|
||||
script=$(sed -n '/docker run/,/^#$/p' "$name/Dockerfile" | head -n -1 | sed "s/#//" | sed "s#\\\##" | tr '\n' ' ' | sed "s/\$@//" | sed 's/""//')
|
||||
echo "Running: $script"
|
||||
|
||||
if [ $TEST ]; then
|
||||
echo $script
|
||||
echo "$script"
|
||||
else
|
||||
eval $script
|
||||
eval "$script"
|
||||
fi
|
||||
|
||||
shift
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# command to run Telnet
|
||||
# docker run -it --rm \
|
||||
# --log-driver none \
|
||||
# jess/telnet "$@"
|
||||
# jess/telnet towel.blinkenlights.nl
|
||||
#
|
||||
FROM alpine:latest
|
||||
LABEL maintainer "Jessie Frazelle <jess@linux.com>"
|
||||
|
|
Loading…
Reference in New Issue
Block a user