-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (40 loc) · 948 Bytes
/
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
FROM alpine:latest
MAINTAINER https://github.com/deebsman
ARG user="toolbox"
ARG system="\
bash\
ca-certificates\
sudo\
exa\
busybox-extras\
"
ARG tools="\
curl\
vim\
openssl\
nmap\
httpie\
jq\
mtr\
git\
go\
sc\
terraform\
ansible\
packer\
mysql-client\
"
ARG gotools="\
github.com/dundee/gdu/v5/cmd/gdu@latest\
"
RUN apk update && apk add $system && apk add $tools
RUN echo $tools > /etc/tools
RUN echo -e "echo -n 'apk: '; cat /etc/tools\necho -n 'go: '; ls /home/toolbox/go/bin" > /usr/local/bin/toollist && chmod a+x /usr/local/bin/toollist
RUN adduser -D $user
RUN echo "$user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$user && chmod 0440 /etc/sudoers.d/$user
USER $user
RUN go install $gotools
RUN echo "alias ll='ls -l'" >> /home/$user/.bashrc
RUN echo "export GOPATH="$HOME/go"" >> /home/$user/.bashrc
RUN echo "export PATH="$PATH:$HOME/go/bin"" >> /home/$user/.bashrc
WORKDIR /home/$user/host