-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
139 lines (125 loc) · 4.15 KB
/
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# vim: set filetype=dockerfile :
ARG DEBIAN_FRONTEND=noninteractive
ARG UBUNTU_VERSION=20.04
FROM ubuntu:${UBUNTU_VERSION}
LABEL org.opencontainers.image.source https://github.com/marvinpinto/kitchensink
LABEL org.opencontainers.image.description="A Kitchen Sink Development Environment"
LABEL org.opencontainers.image.licenses=MIT
# Manually add a /.dockerenv file (to work around buildx not providing it)
RUN touch /.dockerenv
# Base utilities
RUN apt-get -qq update \
&& apt-get install -y \
build-essential \
procps \
curl \
file \
git \
apt-transport-https \
ca-certificates \
bash-completion \
iputils-ping \
wget \
&& apt-get clean autoclean \
&& apt-get autoremove -y --purge \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/
# Linuxbrew setup
RUN groupadd -f linuxbrew \
&& mkdir -p /home/linuxbrew \
&& chown root:linuxbrew /home/linuxbrew \
&& chmod 0775 /home/linuxbrew
# Linuxbrew install
RUN bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
RUN eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" \
&& brew analytics off \
&& brew install gcc git ansible chezmoi \
&& brew tap marvinpinto/kitchensink "https://github.com/marvinpinto/kitchensink.git" \
&& brew install \
aws-vault \
cheat \
fzf \
git \
ansible \
git-lfs \
mkcert \
neovim \
rclone \
jq \
nvm \
terraform \
python \
openjdk@11 \
maven \
docker-compose \
kubectl \
krew \
doctl \
fzf \
restic \
aws-vault \
awscli \
git-delta \
yarn-completion \
gcc@13 \
the_silver_searcher
# Configure timezone and locale
ENV TZ="America/Toronto"
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone \
&& apt-get -qq update \
&& apt-get install -y --no-install-recommends language-pack-en-base tzdata \
&& dpkg-reconfigure -f noninteractive tzdata \
&& echo "LANG=en_US.UTF-8" > /etc/default/locale \
&& echo "LC_ALL=en_US.UTF-8" >> /etc/default/locale \
&& LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 locale-gen --purge en_US.UTF-8 \
&& LANGUAGE=en_US.UTF-8 LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 dpkg-reconfigure -f noninteractive locales \
&& apt-get clean autoclean \
&& apt-get autoremove -y --purge \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/
# Setup nvm + install a few needed NodeJS versions
ENV NVM_DIR /usr/local/nvm
RUN mkdir -p $NVM_DIR \
&& . /home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh \
&& echo "yarn" > $NVM_DIR/default-packages \
&& nvm install lts/iron \
&& nvm install lts/erbium \
&& nvm install lts/fermium \
&& nvm alias default lts/iron \
&& nvm use default
# Utilities needed to run playwright inside the docker container
RUN apt-get -qq update \
&& . /home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh \
&& nvm use lts/fermium \
&& npm install -g playwright \
&& npx playwright install-deps \
&& npm uninstall -g playwright \
&& apt-get clean autoclean \
&& apt-get autoremove -y --purge \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/
# Install the latest version of slc
RUN curl -L "https://github.com/marvinpinto/slc/releases/download/latest/slc_linux_amd64" -o /usr/local/bin/slc \
&& chmod +x /usr/local/bin/slc
# Install the 1password "op" cli tool
COPY --from=1password/op:2 /usr/local/bin/op /usr/local/bin/op
RUN /usr/local/bin/op --version
# pip modules
RUN /home/linuxbrew/.linuxbrew/bin/pip3 install \
--break-system-packages \
--root-user-action=ignore \
openshift pyyaml kubernetes
# Environment setup
RUN mkdir -p /home/worker/app \
&& touch /home/worker/app/.placeholder \
&& chown -R root: /home/worker
VOLUME /home/worker/app
WORKDIR /home/worker/app
ENV HOME /home/worker
ENV PATH /home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/worker/bin:/usr/local/go/bin:/home/worker/.local/bin:$NVM_DIR/version/node/v$NODE_VERSION/bin:$PATH
ENV NODE_PATH $NVM_DIR/version/node/v$NODE_VERSION/lib/node_modules
ENV EDITOR nvim
USER root
ENTRYPOINT "/bin/bash"