-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
719cbc7
commit 3157763
Showing
2 changed files
with
17 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,43 @@ | ||
# syntax=docker/dockerfile:1.4 | ||
FROM --platform=$BUILDPLATFORM alpine:latest | ||
FROM --platform=$BUILDPLATFORM ubuntu:22.04 | ||
|
||
ARG TARGETARCH | ||
ARG VERSION=1.0.1 | ||
ARG VERSION=1.0.1 | ||
ARG RELEASES_URL="https://github.com/ErdemOzgen/blackdagger/releases" | ||
ARG TARGET_FILE="dagu_${VERSION}_linux_${TARGETARCH}.tar.gz" | ||
|
||
|
||
ARG USER="blackdagger" | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
EXPOSE 8080 | ||
EXPOSE 8080 8090 | ||
|
||
RUN <<EOF | ||
#User and permissions setup | ||
apk update | ||
apk add --no-cache sudo tzdata | ||
addgroup -g ${USER_GID} ${USER} | ||
adduser ${USER} -h /home/${USER} -u ${USER_UID} -G ${USER} -D -s /bin/ash | ||
# User and permissions setup | ||
apt-get update | ||
apt-get install -y sudo tzdata wget | ||
groupadd -g ${USER_GID} ${USER} || true | ||
useradd -m ${USER} -u ${USER_UID} -g ${USER_GID} -s /bin/bash | ||
echo ${USER} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USER} | ||
chmod 0440 /etc/sudoers.d/${USER} | ||
|
||
# Download and install gotty | ||
wget https://github.com/some-location/gotty/releases/download/v1.0.0/gotty_linux_amd64 -O /usr/local/bin/gotty | ||
chmod +x /usr/local/bin/gotty | ||
EOF | ||
|
||
USER blackdagger | ||
WORKDIR /home/blackdagger | ||
RUN <<EOF | ||
export TARGET_FILE="blackdagger_${VERSION}_Linux_${TARGETARCH}.tar.gz" | ||
wget ${RELEASES_URL}/download/v${VERSION}/${TARGET_FILE} | ||
tar -xf ${TARGET_FILE} && rm *.tar.gz | ||
sudo mv blackdagger /usr/local/bin/ | ||
tar -xf ${TARGET_FILE} && rm *.tar.gz | ||
sudo mv blackdagger /usr/local/bin/ | ||
mkdir .blackdagger | ||
EOF | ||
|
||
ENV blackdagger_HOST=0.0.0.0 | ||
ENV blackdagger_PORT=8080 | ||
|
||
CMD blackdagger server | ||
# Start blackdagger in the background and gotty in the foreground | ||
CMD bash -c "blackdagger server &" && gotty -p 8090 -w --credential blackcart:blackcart /bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ DST_DIR=$(SRC_DIR)/internal | |
BUILD_VERSION=$(shell date +'%y%m%d%H%M%S') | ||
LDFLAGS=-X 'main.version=$(BUILD_VERSION)' | ||
|
||
VERSION= | ||
VERSION=1.0.1 | ||
DOCKER_CMD := docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --build-arg VERSION=$(VERSION) --push --no-cache | ||
|
||
DEV_CERT_SUBJ_CA="/C=TR/ST=ASIA/L=TOKYO/O=DEV/OU=blackdagger/CN=*.blackdagger.dev/emailAddress[email protected]" | ||
|