File tree Expand file tree Collapse file tree 15 files changed +191
-96
lines changed Expand file tree Collapse file tree 15 files changed +191
-96
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,6 @@ $ ./set --help
27
27
28
28
pull & run image
29
29
```
30
- $ docker pull how2flow/workspace:base
31
- $ docker run -it how2flow/workspace:base
30
+ $ docker pull how2flow/workspace:latest
31
+ $ docker run -it how2flow/workspace:latest
32
32
```
Original file line number Diff line number Diff line change 2
2
Dockerfile.tags
3
3
4
4
# fixups
5
- fixups /pkg
5
+ fixups /* .txt
6
6
7
7
# etc
8
8
* .swp
Original file line number Diff line number Diff line change @@ -19,19 +19,6 @@ USER root
19
19
WORKDIR /root
20
20
COPY fixups fixups
21
21
RUN chmod -R +x fixups
22
- RUN ./fixups/preinst
23
- RUN ./fixups/ssh
24
- RUN ./fixups/id
25
- RUN ./fixups/sudo
26
22
27
- USER ${ID}
28
- WORKDIR /home/${ID}
29
- RUN mkdir -p .vim/colors .vim/bundle
30
- RUN wget -O .gitconfig $WGET_FLAG "https://raw.githubusercontent.com/how2flow/config/master/ubuntu/gitconfig"
31
- RUN wget -O .tmux.conf $WGET_FLAG "https://raw.githubusercontent.com/how2flow/config/master/ubuntu/tmux.conf"
32
- RUN wget -O .vimrc $WGET_FLAG "https://raw.githubusercontent.com/how2flow/config/master/ubuntu/vimrc"
33
- RUN wget -O .vim/colors/gruvbox.vim $WGET_FLAG "https://raw.githubusercontent.com/morhetz/gruvbox/master/colors/gruvbox.vim"
34
- RUN git clone "https://github.com/VundleVim/Vundle.vim.git" .vim/bundle/Vundle.vim
35
- RUN vim +PluginInstall +qall
36
- RUN echo "alias tmux='tmux -2'" >> .bashrc
37
- RUN echo "set -o vi" >> .bashrc
23
+ WORKDIR /root/fixups
24
+ RUN ./prefix
Original file line number Diff line number Diff line change 1
1
# Dockerfile
2
+
3
+ # ===== No Edit =====
2
4
FROM how2flow/workspace:base
5
+ # ===================
3
6
4
7
ENV ID="tags"
5
8
9
+ # ===== No Edit =====
6
10
USER root
7
11
WORKDIR /root
8
12
COPY fixups fixups
9
13
RUN chmod -R +x fixups
10
- RUN ./fixups/pkg
11
- RUN ./fixups/chid $ID
12
- # RUN ./fixups/..
14
+ # ===================
15
+
16
+ # ===== No Edit =====
17
+ WORKDIR /root/fixups
18
+ RUN ./postfix $ID
19
+ # ===================
20
+ # TODO ...
21
+ #
22
+ # ===== No Edit =====
13
23
RUN rm -rf fixups
24
+ # ===================
14
25
26
+ # ===== No Edit =====
15
27
USER ${ID}
16
28
WORKDIR /home/${ID}
17
- # user fixups ...
29
+ # ===================
30
+ # TODO ...
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ CONFDIR=" /root/conf"
Load Diff This file was deleted.
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # configs after preinst.
4
+ # written by how2flow(Steve Jeong).
5
+
6
+ ID=" ${1:- user} "
7
+ GROUP=" ${2:- user} "
8
+ PASSWORD=" ${3:- docker} "
9
+
10
+ ROOT=" $( cd $( dirname $0 ) ; pwd -P ) "
11
+ . " ${ROOT} " /global
12
+
13
+ get_app_configs () {
14
+ local home=" /home/" ${ID} " "
15
+
16
+ # move configs
17
+ if [[ -d " ${CONFDIR} " && -d " ${home} " ]]; then
18
+ mv " ${CONFDIR} " /* " ${home} "
19
+ fi
20
+
21
+ rm -rf " ${CONFDIR} "
22
+
23
+ echo " Finish Download app configs"
24
+ }
25
+
26
+ id_config () {
27
+ # set root password
28
+ echo " root:${PASSWORD} " | chpasswd
29
+
30
+ # set user groups
31
+ groupadd --gid 1000 " ${GROUP} "
32
+
33
+ # set user ID
34
+ useradd --system --create-home --home-dir /home/" ${ID} " \
35
+ --shell /bin/bash --gid " ${GROUP} " --uid 1001 " ${ID} "
36
+
37
+ # set user password
38
+ echo " $ID :${PASSWORD} " | chpasswd
39
+
40
+ echo " Finish ID config"
41
+ }
42
+
43
+ rc_config () {
44
+ local bashrc=" /home/" ${ID} " /.bashrc"
45
+
46
+ # bashrc user confs
47
+ if [ -f " ${bashrc} " ]; then
48
+ echo " alias tmux='tmux -2'" >> " ${bashrc} " /dev/null 2>&1
49
+ echo " set -o vi" >> " ${bashrc} " /dev/null 2>&1
50
+ fi
51
+
52
+ echo " Finish rc config"
53
+ }
54
+
55
+ sudo_config () {
56
+ local sudoers_conf=" /etc/sudoers"
57
+
58
+ # remove sudo warning message
59
+ if [ -x " $( command -v sudo) " ]; then
60
+ usermod -aG sudo " ${ID} "
61
+ touch /home/" ${ID} " /.sudo_as_admin_successful
62
+ fi
63
+
64
+ # sudoers config
65
+ echo " %$id ALL=(ALL) ALL" >> " ${sudoers_conf} "
66
+
67
+ echo " Finish sudo config"
68
+ }
69
+
70
+ main () {
71
+ id_config
72
+ rc_config
73
+ sudo_config
74
+ get_app_configs
75
+ }
76
+
77
+ main
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # configs after preinst.
4
+ # written by how2flow(Steve Jeong).
5
+
6
+ ROOT=" $( cd $( dirname $0 ) ; pwd -P ) "
7
+
8
+ . " ${ROOT} " /global
9
+
10
+ downlaod_app_configs () {
11
+ # download configs
12
+ if [ -x " $( command -v wget) " ]; then
13
+ mkdir -p " ${CONFDIR} "
14
+ wget -O " ${CONFDIR} " /.gitconfig $WGET_FLAG " https://raw.githubusercontent.com/how2flow/config/master/ubuntu/gitconfig"
15
+ wget -O " ${CONFDIR} " /.tmux.conf $WGET_FLAG " https://raw.githubusercontent.com/how2flow/config/master/ubuntu/tmux.conf"
16
+ git clone " https://github.com/VundleVim/Vundle.vim.git" " ${prefix} " /.vim/bundle/Vundle.vim
17
+
18
+ # download configs for vim
19
+ mkdir -p " ${CONFDIR} " /.vim/colors " ${CONFDIR} " /.vim/bundle
20
+ wget -O " ${CONFDIR} " /.vimrc $WGET_FLAG " https://raw.githubusercontent.com/how2flow/config/master/ubuntu/vimrc"
21
+ wget -O " ${CONFDIR} " /.vim/colors/gruvbox.vim $WGET_FLAG " https://raw.githubusercontent.com/morhetz/gruvbox/master/colors/gruvbox.vim"
22
+ fi
23
+ }
24
+
25
+ install_packages () {
26
+ # prefix pacakges: git sudo ssh tmux vim wget
27
+ apt-get update && apt-get install -y --no-install-recommends git sudo ssh tmux vim wget
28
+
29
+ if [ -x " $( command -v brltty) " ]; then
30
+ apt-get remove brltty
31
+ fi
32
+
33
+ echo " Finish install base pacakges"
34
+ }
35
+
36
+ ssh_config () {
37
+ local ssh_config=" /etc/ssh/ssh_config"
38
+
39
+ if [ -x " $( command -v ssh) " ]; then
40
+ echo " HostKeyAlgorithms +ssh-rsa" >> " ${ssh_config} "
41
+ echo " PubkeyAcceptedKeyTypes +ssh-rsa" >> " ${ssh_config} "
42
+ fi
43
+
44
+ echo " Finish ssh config"
45
+ }
46
+
47
+ main () {
48
+ install_packages
49
+ ssh_config
50
+ downlaod_app_configs
51
+ }
52
+
53
+ main
You can’t perform that action at this time.
0 commit comments