Skip to content

Commit

Permalink
Merge pull request #4 from jmeinlschmidt/i-001
Browse files Browse the repository at this point in the history
fixing issue-1
  • Loading branch information
jmeinlschmidt committed Feb 16, 2020
2 parents b0cdc4d + e08bdcf commit c4bafc5
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM debian:latest

ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

COPY config/profile.sh /etc/profile.d/profile.sh
COPY config/profile.sh /root/.bashrc
COPY config/profile.sh /root/.bash_profile
Expand All @@ -13,13 +16,16 @@ RUN apt-get update &&\
nano \
less \
gdb \
wget \
ca-certificates \
openssh-server \
file \
valgrind -y &&\
apt-get update

COPY config/ssh_config /etc/ssh/ssh_config
COPY config/sshd_config /etc/ssh/sshd_config
COPY config/vimconfig /etc/vim/vimrc.local

COPY config/entrypoint.sh /usr/local/bin/entrypoint.sh

Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,11 @@ Combining all together can look like
```
$ docker run --name progtest -td -p 2222:22 -v <HOST_OS_LOCATION>/data:/root/data jmeinlschmidt/progtest:latest <SSH_USERNAME> <SSH_PASSWORD>
```

## Vim

`vim` is displaying white-space characters by default.

In order to disable
- temporarily by executing `:set nolist`
- or permanently by uncommenting `"set nolist` in `~/.vimrc`
8 changes: 8 additions & 0 deletions config/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash
set -e

# Entrypoint get executed at any launch of the container

# Create .vimrc if doesn't exist (important config is stored globally in /etc/vim/vimrc.local)
[[ -e /root/.vimrc ]] || echo "\"set nolist" >/root/.vimrc

if getent passwd "$1" >/dev/null 2>&1; then
printf "\n\033[0;44m---> User already exists\033[0m\n"
else
Expand All @@ -17,6 +22,9 @@ else
echo "$1 ALL=NOPASSWD:/usr/sbin/deluser" >> /etc/sudoers
echo "$1 ALL=NOPASSWD:/usr/sbin/chpasswd" >> /etc/sudoers
echo "$1 ALL=NOPASSWD:/bin/bash" >> /etc/sudoers

# Create .vimrc if doesn't exist
[[ -e /home/$1/.vimrc ]] || echo "\"set nolist" >/home/$1/.vimrc
fi

printf "\n\033[0;44m---> Starting the SSH server.\033[0m\n"
Expand Down
2 changes: 1 addition & 1 deletion config/profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
export PS1='\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\]:\[\e[0;34m\]\w\[\e[0m\]\$ '

export LS_OPTIONS='--color=auto'
eval "`dircolors`"
# eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
Expand Down
8 changes: 8 additions & 0 deletions config/vimconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
syntax on
colorscheme desert
set number

set listchars=eol:¬,tab:>.,trail:~,extends:>,precedes:<,space:␣
set list

set tabstop=4

0 comments on commit c4bafc5

Please sign in to comment.