Skip to content

Commit

Permalink
Add Dockerfile for development container and update configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafq77 committed Dec 2, 2019
1 parent e870c56 commit 4c3ab69
Show file tree
Hide file tree
Showing 6 changed files with 197 additions and 31 deletions.
37 changes: 37 additions & 0 deletions DevSettings/.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Sample .bashrc for SuSE Linux
# Copyright (c) SuSE GmbH Nuernberg

# There are 3 different types of shells in bash: the login shell, normal shell
# and interactive shell. Login shells read ~/.profile and interactive shells
# read ~/.bashrc; in our setup, /etc/profile sources ~/.bashrc - thus all
# settings made here will also take effect in a login shell.
#
# NOTE: It is recommended to make language settings in ~/.profile rather than
# here, since multilingual X sessions would not work properly if LANG is over-
# ridden in every subshell.

# Some applications read the EDITOR variable to determine your favourite text
# editor. So uncomment the line below and enter the editor of your choice :-)
#export EDITOR=/usr/bin/vim
#export EDITOR=/usr/bin/mcedit

# For some news readers it makes sense to specify the NEWSSERVER variable here
#export NEWSSERVER=your.news.server

# If you want to use a Palm device with Linux, uncomment the two lines below.
# For some (older) Palm Pilots, you might need to set a lower baud rate
# e.g. 57600 or 38400; lowest is 9600 (very slow!)
#
#export PILOTPORT=/dev/pilot
#export PILOTRATE=115200

test -s ~/.alias && . ~/.alias || true


export HEADLESS=1
alias go="docker run --net=host -u `id -u`:`id -g` -v /home/`whoami`:/home/`whoami` -v /etc/passwd:/etc/passwd -v /opt/poky-focus/2.7.1:/opt/poky-focus/2.7.1 --entrypoint 'tmux' --rm -it ide_`whoami`:latest"

function cdf()
{
cd "$(dirname "$(find . -name $1 | head -1)")"
}
3 changes: 3 additions & 0 deletions DevSettings/.docker/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"detachKeys" : "ctrl-k,k"
}
23 changes: 11 additions & 12 deletions DevSettings/.gitconfig
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
[credential]
helper = cache --timeout=3600
[alias]
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' -n 30

lg = !"git lg1 --all"

graphviz = "!f() { echo 'digraph git {' ; git log --pretty='format: %h -> { %p };' "$@" | sed 's/[0-9a-f][0-9a-f]*/"&"/g' ; echo ; git log --pretty='format: "%h" [label="%h: %s"];' "$@" ; echo '}'; }; f" git graphviz | dot -Tpng -o a.png
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
editor = vim
[user]
name = Rafq77
[http]
sslVerify = false
[credential]
helper = store
[user]
name = Rafq77
email = [email protected]
[diff]
tool = vimdiff
[core]
excludesfile = /home/sosr/.gitignore_global
[pull]
rebase = true
55 changes: 46 additions & 9 deletions DevSettings/.vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,62 @@ set nu
syntax on
filetype plugin on
filetype plugin indent on
set tabstop=4
set shiftwidth=4
set tabstop=2
set shiftwidth=2
set laststatus=2
set showtabline=2
set hidden
let g:solarized_termcolors=256
"colorscheme solarized
colorscheme desert
colorscheme solarized
"colorscheme desert
set expandtab

"Settings below are critical for vim when running under tmux
set background=dark
set background=light
set t_Co=256

set cursorline

nmap <C-E> :NERDTreeToggle<CR>
map <leader>e :NERDTreeFind<CR>
map gn :bn<CR>
map gp :bp<CR>
python3 from powerline.vim import setup as powerline_setup
python3 powerline_setup()
python3 del powerline_setup
let g:airline#extensions#bufferline#overwrite_variables=0
let g:bufferline_fixed_index = -2
let g:NERDTreeWinSize=60
"let g:bufferline_rotate = 1

"fzf binds
nnoremap <C-p> :Files<CR>
nnoremap <C-h> :Rg<CR>
nmap <F8> :TagbarToggle<CR>
nnoremap <F10> :call ColorschemeGoDark()<CR>
function! ColorschemeGoDark()
colorscheme codedark
set background=dark
endfunction

"function! Osc52Yank()
"let buffer=system('base64 -w0', @0)
"let buffer=substitute(buffer, "\n$", "", "")
"let buffer='\e]52;c;'.buffer.'\x07'
"silent exe "!echo -ne ".shellescape(buffer)." > ".shellescape("/dev/tty")
"endfunction
"
"nnoremap <C-Y>y :call Osc52Yank()<CR>

"command! Osc52CopyYank call Osc52Yank()
"augroup Example
" autocmd!
" autocmd TextYankPost * if v:event.operator ==# 'y' | call Osc52Yank() | endif
"augroup END

" air-line
" let g:airline_powerline_fonts = 1
"
" if !exists('g:airline_symbols')
" let g:airline_symbols = {}
" endif
"
40 changes: 30 additions & 10 deletions DevSettings/.zshrc
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@

# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
export ZSH="${HOME}/.oh-my-zsh"
export ZSH=/home/sosr/.oh-my-zsh

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# ZSH_THEME="robbyrussell" # its an arrow
# ZSH_THEME="candyLine"
ZSH_THEME="agnoster"
# ZSH_THEME="blinks"

# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
Expand Down Expand Up @@ -97,11 +93,35 @@ source $ZSH/oh-my-zsh.sh
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.

#
# Example aliases
alias zshconfig="mate ~/.zshrc"

# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias wwc="cd /mnt/c/work/03_training/20180819_CPP/share/cpp11-course/exercise/graphics/"
alias tmp="sudo systemd-tmpfiles --create"

alias tags="ctags -R ."

export LANG="en_US.UTF-8"
export FZF_DEFAULT_COMMAND='rg --files'

#within docker

function cdf()
{
cd "$(dirname "$(find . -name $1 | head -1)")"
}

function c()
{
cd $(dirname $(fzf))
}

function f()
{
find . -name $1
}

function e()
{
grep . -rnwe $1
}

70 changes: 70 additions & 0 deletions DevSettings/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@

# build image
# docker build --build-arg http_proxy=http://3128 -t focus-dev .
# docker run -u `id -u`:`id -g` --net=host -v /home/sosr:/home/sosr -v /etc/passwd:/etc/passwd --rm -it ide_sosr:latest

FROM ubuntu:disco

ARG USER_NAME="sosr"
ARG PW="sosr"

ENV USER_NAME $USER_NAME

# Install Base system
RUN \
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
cmake \
git \
clang \
vim \
g++ \
zsh \
make \
python \
python-jinja2 \
python-pkg-resources \
valgrind \
exuberant-ctags \
fonts-powerline \
locales \
wget \
fzf \
ripgrep \
graphviz \
doxygen \
xvfb \
tmux && \
rm -rf /var/cache/apt/archives && \
rm -rf /*.deb

# Provide vzug specific font
COPY ./fonts/* /usr/share/fonts/

RUN \
chmod a+rx /usr/share/fonts/*.ttf && \
ln -s /usr/lib/x86_64-linux-gnu/dri /usr/lib/dri && \
ln -s /lib/x86_64-linux-gnu/ld-2.29.so /lib/ld-linux-x86-64.so.2 && \
ln -s /lib/x86_64-linux-gnu/libc.so.6 /lib64/libc.so.6 && \
ln -s /opt /esm && \
ln -s /esm/poky-focus /esm/poky-focus-1.0 && \
mkdir -p /opt/poky-focus

RUN \
locale-gen en_US.UTF-8 && \
adduser --quiet --disabled-password --shell /bin/zsh --home /home/$USER_NAME --gecos "User" $USER_NAME && \
echo "${USER_NAME}:${PW}" | chpasswd && usermod -aG sudo $USER_NAME

# the user we're applying this too (otherwise it most likely install for root)
USER $USER_NAME
ENV TERM screen-256color-bce
ENV ZSH_THEME agnoster
ENV LANG "en_US.UTF-8"
ENV FZF_DEFAULT_COMMAND "rg --files --hidden"


WORKDIR /home/$USER_NAME

RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true ; #chmod +x ./install.sh; sh ./install.sh; rm ./install.sh #

ENTRYPOINT ["zsh"]

0 comments on commit 4c3ab69

Please sign in to comment.