Skip to content

Commit 9a21e39

Browse files
author
Steve Jeong
committed
docker: New image 'how2flow/workspace/jekyll'
Signed-off-by: Steve Jeong <[email protected]>
1 parent 0868144 commit 9a21e39

File tree

5 files changed

+151
-0
lines changed

5 files changed

+151
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: 'docker-jekyll (CI/CD)'
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
paths:
8+
- 'docker/jekyll/*'
9+
tags-ignore:
10+
- 'v2.0.*'
11+
workflow_dispatch:
12+
inputs:
13+
logLevel:
14+
description: 'Log level'
15+
required: true
16+
default: 'warning'
17+
tags:
18+
description: 'Test scenario tags'
19+
20+
jobs:
21+
docker:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: 'Checkout'
25+
uses: actions/Checkout@v3
26+
27+
- name: 'Get release date'
28+
id: 'release-date'
29+
run: |
30+
echo "RELEASE_DATE=$(date '+%Y%m%d')" >> $GITHUB_OUTPUT
31+
32+
- name: 'Docker upload'
33+
uses: how2flow/upload-docker-action@v1
34+
with:
35+
context: 'docker/jekyll'
36+
repository: 'workspace'
37+
release: 'jekyll'
38+
username: ${{ secrets.DOCKERHUB_USERNAME }}
39+
password: ${{ secrets.DOCKERHUB_TOKEN }}

docker/jekyll/Dockerfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Dockerfile
2+
FROM ubuntu:20.04
3+
LABEL author="Steve Jeong"
4+
LABEL e-mail="[email protected]"
5+
LABEL github="how2flow"
6+
LABEL version="0.0.1"
7+
8+
ARG DEBIAN_FRONTEND=noninteractive
9+
10+
SHELL ["/bin/bash", "-c"]
11+
ENV LC_ALL=C.UTF-8
12+
13+
# vars
14+
ENV USER="user" \
15+
TZ="Asia/Seoul" \
16+
CSCOPE="https://raw.githubusercontent.com/how2flow/config/ubuntu/mkcscope.sh" \
17+
GITCONFIG="https://raw.githubusercontent.com/how2flow/config/ubuntu/gitconfig" \
18+
TMUXCONFIG="https://raw.githubusercontent.com/how2flow/config/ubuntu/tmux.conf" \
19+
VIMCONFIG="https://raw.githubusercontent.com/how2flow/config/ubuntu/vimrc" \
20+
VIMCOLORS="https://raw.githubusercontent.com/morhetz/gruvbox/master/colors/gruvbox.vim"
21+
22+
# set timezone.
23+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
24+
25+
# root user fixups
26+
USER root
27+
WORKDIR /root
28+
COPY packages packages
29+
COPY user user
30+
RUN chmod +x packages user
31+
RUN ./packages && rm packages
32+
RUN ./user $USER && rm user
33+
RUN wget -O /usr/bin/mkcscope.sh --no-check-certificate $CSCOPE
34+
35+
# normal user fixups
36+
USER $USER
37+
WORKDIR /home/$USER
38+
RUN mkdir -p .vim/colors && \
39+
mkdir -p .vim/bundle
40+
RUN wget -O .gitconfig --no-check-certificate $GITCONFIG && \
41+
wget -O .tmux.conf --no-check-certificate $TMUXCONFIG && \
42+
wget -O .vimrc --no-check-certificate $VIMCONFIG && \
43+
wget -O .vim/colors/gruvbox.vim --no-check-certificate $VIMCOLORS
44+
RUN git clone "https://github.com/VundleVim/Vundle.vim.git" \
45+
.vim/bundle/Vundle.vim
46+
RUN vim +PluginInstall +qall
47+
RUN echo "alias tmux='tmux -2'" >> .bashrc
48+
RUN echo "set -o vi" >> .bashrc

docker/jekyll/docker-compose.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: '3'
2+
3+
volumes:
4+
share_data: {}
5+
kernel: {}
6+
7+
services:
8+
workspace:
9+
image: how2flow/workspace:focal
10+
container_name: work-focal
11+
stdin_open: true
12+
tty: true
13+
volumes:
14+
- share_data:/var/lib/share_data
15+
- kernel:/var/lib/kernel
16+
environment:
17+
- PYTHONUNBUFFERED=0
18+
port:
19+
- 4000:4000
20+
21+
# docker compose up -d
22+
# docker attach work-focal

docker/jekyll/packages

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
apt-get update && apt-get install -y --no-install-recommends \
4+
build-essential \
5+
flex \
6+
fonts-nanum \
7+
git \
8+
libssl-dev \
9+
rsync \
10+
ruby \
11+
ruby-dev \
12+
software-properties-common \
13+
ssh \
14+
sudo \
15+
tig \
16+
tmux \
17+
vim \
18+
wget

docker/jekyll/user

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# https://github.com/how2flow/docker_ws/example/docker.user
4+
# written by steve.jeong <[email protected]>
5+
6+
id=$1
7+
password="docker"
8+
9+
# set root password
10+
echo "root:${password}" | chpasswd
11+
12+
# user account
13+
groupadd --gid 1000 ${id} && \
14+
useradd --system --create-home --home-dir /home/${id} \
15+
--shell /bin/bash --gid ${id} --uid 1001 ${id}
16+
# --password ${id}
17+
# password option is just crypted in /etc/shadow.
18+
# It is not applied to the actual.
19+
20+
# set sudoers
21+
echo "%$id ALL=(ALL) ALL" >> /etc/sudoers
22+
23+
# set user password
24+
echo "$id:${password}" | chpasswd

0 commit comments

Comments
 (0)