mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2024-11-27 04:16:45 +01:00
update
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
parent
3dc34a5d20
commit
d70bc2e261
11
buildfromtarball/Dockerfile
Normal file
11
buildfromtarball/Dockerfile
Normal file
|
@ -0,0 +1,11 @@
|
|||
FROM docker
|
||||
|
||||
RUN apk install --no-cache \
|
||||
bash \
|
||||
ca-certificates \
|
||||
curl \
|
||||
tar
|
||||
|
||||
COPY build.sh /usr/local/bin/build
|
||||
|
||||
ENTRYPOINT ["build"]
|
22
buildfromtarball/build.sh
Executable file
22
buildfromtarball/build.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
set -x
|
||||
|
||||
tarball=$1
|
||||
image=$2
|
||||
|
||||
volume=/build
|
||||
|
||||
mkdir -p "$build"
|
||||
|
||||
curl --fail --silent --show-error --location "$tarball" | tar xvz --strip=1 -C %s 2>/dev/null) || (echo ""; printf "ERROR: %%s\n" "Could not prepare an image." "Please verify that $tarball is still available and is publicly accessible."; exit 1)
|
||||
|
||||
# Try to pull the image.
|
||||
docker pull "$image" || true
|
||||
|
||||
cd "$build"
|
||||
|
||||
docker build --cache-from "$image" -t "$image" .
|
||||
|
||||
docker push "$image"
|
Loading…
Reference in New Issue
Block a user