Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
add the Dockerfile of doko-full image, add new tasks to Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
abdfnx committed Jan 5, 2022
1 parent 25f84fc commit 3284f3e
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ DATE=$(shell go run ./scripts/date.go)

build:
@go mod tidy && \
go build -ldflags "-X main.version=$(TAG) -X main.buildDate=$(DATE)" -o resto
go build -ldflags "-X main.version=$(TAG) -X main.buildDate=$(DATE)" -o doko

install: doko
@mv doko /usr/local/bin

brc: # build doko container
@docker build -t dokocli/doko . && \
docker push dokocli/doko

bfrc: # build full doko container
@docker build -t dokocli/doko-full --file ./docker/doko-full/Dockerfile . && \
docker push dokocli/doko-full
57 changes: 57 additions & 0 deletions docker/doko-full/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
FROM debian:latest

### variables ###
ARG UPD="apt-get update"
ARG UPD_s="sudo $UPD"
ARG INS="apt-get install"
ARG INS_s="sudo $INS"
ENV PKGS="zip unzip multitail curl lsof wget ssl-cert asciidoctor apt-transport-https ca-certificates gnupg-agent bash-completion build-essential htop jq software-properties-common less llvm locales man-db nano vim ruby-full build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev libbz2-dev"

RUN $UPD && $INS -y $PKGS && $UPD && \
locale-gen en_US.UTF-8 && \
mkdir /var/lib/apt/abdcodedoc-marks && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* && \
$UPD

ENV LANG=en_US.UTF-8

### git ###
RUN $INS -y git && \
rm -rf /var/lib/apt/lists/* && \
$UPD

### sudo ###
RUN $UPD && $INS -y sudo && \
adduser --disabled-password --gecos '' doko-user && \
adduser doko-user sudo && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

ENV HOME="/home/doko-user"
WORKDIR $HOME
USER doko-user

### go ###
COPY --from=golang /usr/local/go/ /usr/local/go/
ENV PATH="/usr/local/go/bin:${PATH}"

### doko ###
RUN curl -sL https://git.io/doko | bash

### zsh ###
ENV src=".zshrc"

RUN $INS_s zsh -y
RUN zsh && \
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" && \
$UPD_s && \
git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting && \
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

### rm old ~/.zshrc ###
RUN sudo rm -rf $src

### wget new files ###
RUN wget https://abdfnx.github.io/doko/scripts/shell/zshrc -o $src
RUN wget https://abdfnx.github.io/doko/scripts/shell/README

CMD /bin/bash -c "cat README && zsh"

0 comments on commit 3284f3e

Please sign in to comment.