Quellcode durchsuchen

Mostly working, hopefully all working

pull/74/head
Aode vor 1 Monat
Ursprung
Commit
4c7836424d

+ 20
- 6
Makefile Datei anzeigen

@@ -1,10 +1,24 @@
all: pull-containers build-deps build-images
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
IMAGE_NAME = "asonix/masto-deps"

pull-containers:
masto: pull-deps images push-images

all: pull-base deps push-deps pull-deps images push-images

pull-base:
./container/pull-containers.sh

build-deps:
./container/build-images.sh Dockerfile-deps ubuntu-dependencies
deps:
./container/build-images.sh container/Dockerfile-deps $(IMAGE_NAME)

push-deps:
./container/push-containers.sh $(IMAGE_NAME)

pull-deps:
./container/pull-containers.sh $(IMAGE_NAME)

images:
./container/build-images.sh container/Dockerfile "$(GIT_BRANCH)"

build-images:
./container/build-images.sh Dockerfile $(git rev-parse --abbrev-ref HEAD)
push-images:
./container/push-containers.sh $(GIT_BRANCH)

+ 1
- 1
container/Dockerfile Datei anzeigen

@@ -1,4 +1,4 @@
FROM localhost/ubuntu-dependencies-amd64:latest as build-dep
FROM asonix/masto-deps:amd64 as build-dep

# Use bash for the shell
SHELL ["bash", "-c"]

+ 1
- 4
container/Dockerfile-deps Datei anzeigen

@@ -1,7 +1,4 @@
FROM ubuntu:18.04

# Use bash for the shell
SHELL ["bash", "-c"]
FROM amd64/ubuntu:18.04

# Install Node
ENV NODE_VER="12.11.1"

+ 13
- 9
container/build-images.sh Datei anzeigen

@@ -18,21 +18,25 @@ require_input() {
require_input "$SOURCE" "Dockerfile"
require_input "$TAG" "container tag"

architectures=('arm64v8' 'arm32v7' 'amd64')
ARCHITECTURES=('arm64v8' 'arm32v7' 'amd64')

for architecture in "${architectures[@]}"; do
sed "s/FROM ubuntu/FROM $architecture\/ubuntu/g" "$SOURCE" > ""$SOURCE"-$architecture"
for architecture in "${ARCHITECTURES[@]}"; do
cp "$SOURCE" "$SOURCE-$architecture"
if [ "$architecture" == arm32v7 ]; then
sed -i'' 's/x64/armv7l/g' ""$SOURCE"-$architecture" # for node
sed -i'' 's/amd64/armhf/g' ""$SOURCE"-$architecture" # for tini
sed -i'' 's/:amd64/:arm32v7/g' "$SOURCE-$architecture" # source image
sed -i'' 's/FROM amd64/FROM arm32v7/g' "$SOURCE-$architecture" # source image
sed -i'' 's/x64/armv7l/g' "$SOURCE-$architecture" # for node
sed -i'' 's/amd64/armhf/g' "$SOURCE-$architecture" # for tini
fi

if [ "$architecture" == arm64v8 ]; then
sed -i'' 's/x64/arm64/g' ""$SOURCE"-$architecture" # for node
sed -i'' 's/amd64/arm64/g' ""$SOURCE"-$architecture" # for tini
sed -i'' 's/:amd64/:arm64v8/g' "$SOURCE-$architecture" # source image
sed -i'' 's/FROM amd64/FROM arm64v8/g' "$SOURCE-$architecture" # source image
sed -i'' 's/x64/arm64/g' "$SOURCE-$architecture" # for node
sed -i'' 's/amd64/arm64/g' "$SOURCE-$architecture" # for tini
fi

buildah build-using-dockerfile -f ""$SOURCE"-$architecture" -t "$TAG-$architecture" ..
buildah build-using-dockerfile -f "$SOURCE-$architecture" -t "$TAG:$architecture" .

rm ""$SOURCE"-$architecture"
rm "$SOURCE-$architecture"
done

+ 5
- 1
container/pull-containers.sh Datei anzeigen

@@ -5,5 +5,9 @@ set -xe
architectures=('arm64v8' 'arm32v7' 'amd64')

for architecture in "${architectures[@]}"; do
podman pull "$architecture/ubuntu:18.04"
if [ "$1" == "" ]; then
podman pull "$architecture/ubuntu:18.04"
else
podman pull "$1:$architecture"
fi
done

+ 23
- 0
container/push-containers.sh Datei anzeigen

@@ -0,0 +1,23 @@
#!/usr/bin/env bash

set -xe

TAG=$1

require_input() {
input=$1
name=$2

if [ "$input" == "" ]; then
echo "Input, $name, required but not present"
exit 1;
fi
}

require_input "$TAG" "container tag"

ARCHITECTURES=('arm64v8' 'arm32v7' 'amd64')

for arch in "${ARCHITECTURES[@]}"; do
podman push "$TAG:$arch" "docker://docker.io/asonix/masto-deps:$arch"
done

Laden…
Abbrechen
Speichern