Skip to content

Commit 0d7bded

Browse files
author
samuel.gondouin
committed
Add script
1 parent 2a33e24 commit 0d7bded

File tree

6 files changed

+22
-19
lines changed

6 files changed

+22
-19
lines changed

Dockerfile

+1-14
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ RUN apt-get update \
2424
&& apt-get autoremove \
2525
&& rm -rf /var/lib/apt/lists/*
2626

27-
RUN useradd -m -s /bin/zsh util01 && echo "util01:mot2passe" | chpasswd && adduser util01 sudo
28-
2927
RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true
3028
RUN chsh -s /usr/bin/zsh
3129
RUN git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/custom/zsh
@@ -35,15 +33,4 @@ RUN git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/t
3533
RUN sed -i 's/robbyrussell/powerlevel9k\/powerlevel9k/' ~/.zshrc
3634
RUN sed -i 's/ git/ git zsh-syntax-highlighting zsh-autosuggestions colored-man-colored/' ~/.zshrc
3735

38-
RUN cp ~/.zshrc ~/aa
39-
RUN echo export TERM="xterm-256color" > ~/.zshrc
40-
RUN cat ~/aa >> ~/.zshrc
41-
RUN rm ~/aa
42-
43-
RUN cp ~/.zshrc /home/util01/
44-
RUN sed -i 's/ export ZSH=\"\/root\/.oh-my-zsh\"/export ZSH=\"\/home\/util01\/.oh-my-zsh\"/' /home/util01/.zshrc
45-
RUN cp -R ~/.oh-my-zsh /home/util01
46-
RUN chown -R util01:util01 /home/util01/
47-
48-
RUN mkdir /home/util01/volume01 && \
49-
chown -R util01:util01 /home/util01/volume01
36+
RUN cp ~/.zshrc ~/aa && echo export TERM="xterm-256color" > ~/.zshrc && cat ~/aa >> ~/.zshrc && rm ~/aa

build.sh renamed to buildImage.sh

File renamed without changes.

createVolume.sh

-4
This file was deleted.

createVolumeUser.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
docker volume create voluser
4+
docker volume ls

exec.sh renamed to execImage.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
docker run --hostname local \
44
--rm \
5-
-v volume01:/home/util01/volume01 \
5+
-v voluser:/home/voluser \
6+
-v "$(pwd)"/script:/script \
67
-ti nekrofage/ubuntu1804test:latest \
78
/bin/zsh

script/configuser.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
3+
USER=util01
4+
5+
echo "User setup"
6+
7+
useradd -m -s /bin/zsh -d /home/voluser/$USER $USER
8+
echo "$USER:mot2passe" | chpasswd
9+
adduser $USER sudo
10+
11+
cp ~/.zshrc /home/voluser/$USER/
12+
sed -i 's/ export ZSH=\"\/root\/.oh-my-zsh\"/export ZSH=\"\/home\/voluser\/$USER\/.oh-my-zsh\"/' /home/voluser/$USER/.zshrc
13+
cp -R ~/.oh-my-zsh /home/voluser/$USER
14+
15+

0 commit comments

Comments
 (0)