-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.kernel-repo
51 lines (46 loc) · 1.24 KB
/
Dockerfile.kernel-repo
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
#
# Dockerfile.ubuntu-dev: General Ubuntu dev eenvironment w/ sudo rights
#
FROM ubuntu:18.04
MAINTAINER John Stultz <[email protected]>
ENV TERM xterm
# Update the image to the lastest updates
RUN apt-get update && apt-get -y dist-upgrade && apt-get clean && apt-get -y autoremove
# Get tools
RUN apt-get update && apt-get install -y \
autoconf \
bc \
bison \
cpio \
flex \
gawk \
gcc \
git \
kmod \
libelf-dev \
libncurses5-dev \
libssl-dev \
libtool \
libxml2-dev \
make \
python \
python3 \
rsync \
sudo \
vim \
zlib1g-dev
# make username a variable, so the script is portable
# add '--build-arg user_name=$USER' to the docker build command
ARG --description="user name for container" user_name=docker
# Add $user_name user
RUN useradd -m $user_name && echo "$user_name:docker" | chpasswd && adduser $user_name sudo
USER $user_name
# create run-script
run echo '#!/bin/bash' > /home/$user_name/run-script.sh
run echo 'if [[ -z "${COMMAND}" ]]; then echo "No COMMAND value"; exit; fi' >> /home/$user_name/run-script.sh
run echo 'cd ; cd repo' >> /home/$user_name/run-script.sh
run echo '$COMMAND' >> /home/$user_name/run-script.sh
run chmod +x /home/$user_name/run-script.sh
WORKDIR /home/$user_name
USER $user_name
CMD ./run-script.sh