forked from SAP/fundamental-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ubuntu-qa.Dockerfile
76 lines (60 loc) · 2.45 KB
/
ubuntu-qa.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# syntax = edrevo/dockerfile-plus
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0
#
# Build:
# docker build -t ubuntu-qa -f ubuntu-qa.Dockerfile .
# docker run -it --name ubuntu-qa -v /Users/d037732/src:/home/www-admin/src ubuntu-qa /bin/bash --login
#
# Run:
# docker start -ai ubuntu-qa
#
FROM ubuntu:latest
LABEL maintainer="[email protected]"
LABEL version="2.0"
LABEL description="Ubuntu QAS"
ARG adminuser=www-admin
ARG dev_tools="sudo curl wget git unzip vim tree tmux iproute2 iputils-ping"
ARG dev_libs="build-essential make ninja-build libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev"
ENV container docker
# os update and packages
USER root
RUN \
sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \
apt update && DEBIAN_FRONTEND=noninteractive apt install -y locales ${dev_tools} ${dev_libs} && \
rm -rf /var/lib/apt/lists/*
# pythons build fails if --no-install-recommends option used here
# timezone # https://serverfault.com/questions/683605/docker-container-time-timezone-will-not-reflect-changes
ENV TZ=Europe/Berlin
RUN locale-gen de_DE && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# https://daten-und-bass.io/blog/fixing-missing-locale-setting-in-ubuntu-docker-image/
RUN \
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8 && \
# admin user
adduser --disabled-password --gecos "" ${adminuser} && \
usermod -aG www-data,sudo ${adminuser} && \
echo "${adminuser} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
# cleanup
rm -rf /tmp/* /var/lib/apt/lists/*
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
# sap binaries
INCLUDE+ common/saplibs.Dockerfile
# work user
USER ${adminuser}
WORKDIR /home/${adminuser}
RUN printf "alias e=exit\nalias ..=cd..\nalias :q=exit\nalias ll='ls -l'\nalias la='ls -la'\nalias distro='cat /etc/*-release'\n" > .bash_aliases && \
printf "\n# colors\nexport TERM=xterm-256color\n" >> ~/.bashrc && \
# git configuration
git config --global http.sslVerify false && \
git config --global user.name bsrdjan && \
git config --global user.email [email protected] && \
git config --global pull.rebase false
# python
INCLUDE+ common/python.Dockerfile
# nvm
INCLUDE+ common/nodejs.Dockerfile
SHELL ["/bin/bash"]