mirror of
https://github.com/fbartels/cloudron-drone-app.git
synced 2024-09-27 05:19:57 +00:00
Compare commits
2 commits
32c4e2e929
...
2f413b92b1
Author | SHA1 | Date | |
---|---|---|---|
|
2f413b92b1 | ||
|
0ac667af18 |
3 changed files with 81 additions and 8 deletions
|
@ -1,4 +1,41 @@
|
||||||
FROM node:lts-alpine3.12
|
FROM node:lts as build
|
||||||
RUN apk add --no-cache make python3 zip
|
|
||||||
# use --unsafe to not execute post actions as user nobody
|
# use --unsafe to not execute post actions as user nobody
|
||||||
RUN npm -g install cloudron-surfer@5.17.5 --unsafe && npm cache clean --force && surfer --version
|
RUN npm -g install cloudron-surfer@6.0.0 --unsafe && \
|
||||||
|
npm cache clean --force && \
|
||||||
|
surfer --version
|
||||||
|
|
||||||
|
FROM build as distrobox
|
||||||
|
# Install essential packages and locales
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
apt-utils \
|
||||||
|
bash \
|
||||||
|
bash-completion \
|
||||||
|
bc \
|
||||||
|
curl \
|
||||||
|
dialog \
|
||||||
|
diffutils \
|
||||||
|
findutils \
|
||||||
|
gnupg2 \
|
||||||
|
less \
|
||||||
|
libegl1-mesa \
|
||||||
|
libgl1-mesa-glx \
|
||||||
|
libnss-myhostname \
|
||||||
|
libvte-2.9*-common \
|
||||||
|
libvte-common \
|
||||||
|
libvulkan1 \
|
||||||
|
locales \
|
||||||
|
lsof \
|
||||||
|
mesa-vulkan-drivers \
|
||||||
|
ncurses-base \
|
||||||
|
passwd \
|
||||||
|
pinentry-curses \
|
||||||
|
procps \
|
||||||
|
sudo \
|
||||||
|
time \
|
||||||
|
tzdata \
|
||||||
|
util-linux \
|
||||||
|
wget
|
||||||
|
|
||||||
|
# make sure that the distrobox stage is not the last one
|
||||||
|
FROM build as surfer
|
|
@ -2,20 +2,26 @@ DOCKER_REPO ?= fbartels
|
||||||
DOCKER_IMAGE := cloudron-surfer
|
DOCKER_IMAGE := cloudron-surfer
|
||||||
VERSION := $(shell grep cloudron-surfer Dockerfile | cut -d' ' -f 5 | cut -d@ -f 2)
|
VERSION := $(shell grep cloudron-surfer Dockerfile | cut -d' ' -f 5 | cut -d@ -f 2)
|
||||||
|
|
||||||
|
ifeq ($(shell command -v podman 2> /dev/null),)
|
||||||
|
CMD=docker
|
||||||
|
else
|
||||||
|
CMD=podman
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: default
|
.PHONY: default
|
||||||
default: build
|
default: build
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build:
|
build:
|
||||||
docker build . -t $(DOCKER_IMAGE)
|
$(CMD) build . -t $(DOCKER_IMAGE)
|
||||||
|
|
||||||
.PHONY: tag
|
.PHONY: tag
|
||||||
tag: build
|
tag: build
|
||||||
docker tag $(DOCKER_IMAGE) $(DOCKER_REPO)/$(DOCKER_IMAGE):latest
|
$(CMD) tag $(DOCKER_IMAGE) $(DOCKER_REPO)/$(DOCKER_IMAGE):latest
|
||||||
docker tag $(DOCKER_IMAGE) $(DOCKER_REPO)/$(DOCKER_IMAGE):$(VERSION)
|
$(CMD) tag $(DOCKER_IMAGE) $(DOCKER_REPO)/$(DOCKER_IMAGE):$(VERSION)
|
||||||
|
|
||||||
.PHONY: push
|
.PHONY: push
|
||||||
push: tag
|
push: tag
|
||||||
docker push $(DOCKER_REPO)/$(DOCKER_IMAGE):latest
|
$(CMD) push $(DOCKER_REPO)/$(DOCKER_IMAGE):latest
|
||||||
docker push $(DOCKER_REPO)/$(DOCKER_IMAGE):$(VERSION)
|
$(CMD) push $(DOCKER_REPO)/$(DOCKER_IMAGE):$(VERSION)
|
||||||
|
|
||||||
|
|
30
helpers/surfer/build.sh
Executable file
30
helpers/surfer/build.sh
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -Eeuo pipefail
|
||||||
|
|
||||||
|
DOCKER_IMAGE=${DOCKER_IMAGE:-git.9wd.eu/felix/cloudron-surfer}
|
||||||
|
VERSION=$(grep cloudron-surfer Dockerfile | cut -d' ' -f 5 | cut -d@ -f 2)
|
||||||
|
|
||||||
|
# Function to check if a command is available
|
||||||
|
command_exists() {
|
||||||
|
command -v "$1" >/dev/null 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
if command_exists podman; then
|
||||||
|
CMD="podman"
|
||||||
|
elif command_exists docker; then
|
||||||
|
CMD="docker"
|
||||||
|
else
|
||||||
|
echo "Error: Neither podman nor docker is installed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
$CMD build . -t "$DOCKER_IMAGE:latest"
|
||||||
|
$CMD build . --target distrobox -t "$DOCKER_IMAGE:distrobox"
|
||||||
|
|
||||||
|
$CMD tag "$DOCKER_IMAGE:latest" "$DOCKER_IMAGE:$VERSION"
|
||||||
|
|
||||||
|
if [ "${1:-}" == "push" ]; then
|
||||||
|
$CMD push "$DOCKER_IMAGE:latest"
|
||||||
|
$CMD push "$DOCKER_IMAGE:$VERSION"
|
||||||
|
$CMD push "$DOCKER_IMAGE:distrobox"
|
||||||
|
fi
|
Loading…
Reference in a new issue