Compare commits

..

No commits in common. "2f413b92b10d5b7c5278419873300e808b808341" and "32c4e2e929542d7e5e954e45dee9cc333d5bb00e" have entirely different histories.

3 changed files with 8 additions and 81 deletions

View file

@ -1,41 +1,4 @@
FROM node:lts as build
FROM node:lts-alpine3.12
RUN apk add --no-cache make python3 zip
# use --unsafe to not execute post actions as user nobody
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
RUN npm -g install cloudron-surfer@5.17.5 --unsafe && npm cache clean --force && surfer --version

View file

@ -2,26 +2,20 @@ DOCKER_REPO ?= fbartels
DOCKER_IMAGE := cloudron-surfer
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
default: build
.PHONY: build
build:
$(CMD) build . -t $(DOCKER_IMAGE)
docker build . -t $(DOCKER_IMAGE)
.PHONY: tag
tag: build
$(CMD) tag $(DOCKER_IMAGE) $(DOCKER_REPO)/$(DOCKER_IMAGE):latest
$(CMD) tag $(DOCKER_IMAGE) $(DOCKER_REPO)/$(DOCKER_IMAGE):$(VERSION)
docker tag $(DOCKER_IMAGE) $(DOCKER_REPO)/$(DOCKER_IMAGE):latest
docker tag $(DOCKER_IMAGE) $(DOCKER_REPO)/$(DOCKER_IMAGE):$(VERSION)
.PHONY: push
push: tag
$(CMD) push $(DOCKER_REPO)/$(DOCKER_IMAGE):latest
$(CMD) push $(DOCKER_REPO)/$(DOCKER_IMAGE):$(VERSION)
docker push $(DOCKER_REPO)/$(DOCKER_IMAGE):latest
docker push $(DOCKER_REPO)/$(DOCKER_IMAGE):$(VERSION)

View file

@ -1,30 +0,0 @@
#!/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