-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
132 lines (116 loc) · 3.78 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
####### VERSIONS #######
FROM debian:stretch
###### GENERIC DOCKER STUFF #######
LABEL maintainer "[email protected]"
#Non-interactive console during docker build process
ARG DEBIAN_FRONTEND=noninteractive
#Install apt-utils so debconf doesn't complain about configuration for every
# other install
RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
apt-utils \
&& rm -rf /var/lib/apt/lists/*
#Set the locale
RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
locales \
&& rm -rf /var/lib/apt/lists/* \
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
&& dpkg-reconfigure locales \
&& echo ': "${LANG:=en_US.utf8}"; export LANG' >> /etc/profile
#Start the entrypoint script
RUN echo '#!/bin/bash' > entrypoint.sh \
&& chmod 0700 /entrypoint.sh
#Create regular user (dev) and groups
RUN \
adduser --gecos "" --shell /bin/bash --disabled-password dev
####### KFRAMEWORK #######
# Dependencies
RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
aspcud \
build-essential \
darcs \
flex \
git \
libfl-dev \
libgmp-dev \
libmpfr-dev \
libz3-dev \
m4 \
maven \
mercurial \
ocaml \
opam \
openjdk-8-jdk \
pkg-config \
python3 \
rsync \
z3 \
&& rm -rf /var/lib/apt/lists/*
# Clone and install
RUN \
git clone --depth=1 https://github.com/kframework/k5.git \
&& chown -hR dev:dev k5
WORKDIR /k5
USER dev
RUN \
mvn package \
&& k-distribution/target/release/k/bin/k-configure-opam \
&& opam config setup -a
WORKDIR /
USER root
RUN \
chown -hR root:root k5
# Update PROFILE
RUN \
echo '' >> /home/dev/.profile \
&& echo 'if [ -d "/k5/k-distribution/target/release/k/bin" ] ; then' >> /home/dev/.profile \
&& echo ' PATH="/k5/k-distribution/target/release/k/bin:$PATH"' >> /home/dev/.profile \
&& echo 'fi' >> /home/dev/.profile
####### VIM #######
RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
vim \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy user vimrc
COPY ./customize/.vimrc /home/dev/.vimrc.bak
RUN chown dev:dev /home/dev/.vimrc.bak \
&& chmod 0644 /home/dev/.vimrc.bak
USER dev
RUN \
# Install pathogen - plugin manager
mkdir -p /home/dev/.vim/autoload /home/dev/.vim/bundle \
&& curl -LSo /home/dev/.vim/autoload/pathogen.vim \
https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim \
#Configure pathogen
#Delete following lines if your vimrc enables pathogen
&& echo '"Turn on plugin manager' >> /home/dev/.vimrc \
&& echo 'execute pathogen#infect()' >> /home/dev/.vimrc \
# Install sensible - mostly uncontentious defaults
&& git clone --depth=1 https://github.com/tpope/vim-sensible.git /home/dev/.vim/bundle/sensible \
# Install vim-kframework
&& mkdir -p /home/dev/.vim/bundle/vim-kframework/syntax \
&& curl -LSo /home/dev/.vim/bundle/vim-kframework/syntax/kframework.vim \
https://raw.githubusercontent.com/kframework/k-editor-support/master/vim/kframework.vim \
&& mkdir /home/dev/.vim/bundle/vim-kframework/ftdetect \
&& echo 'au BufRead,BufNewFile *.k set filetype=kframework' \
> /home/dev/.vim/bundle/vim-kframework/ftdetect/kframework.vim \
# apply customized vimrc
&& echo '' >> /home/dev/.vimrc \
&& cat /home/dev/.vimrc.bak >> /home/dev/.vimrc
USER root
####### STARTUP #######
RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
gosu \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* \
&& echo 'exec gosu dev /bin/bash' >> /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]