-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
52 lines (43 loc) · 2.04 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
# Dockerfile for completing CS3103 tutorials
# Copyright (C) 2025 CHAN Cheuk Long
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Choose Linux based distro
FROM alpine:latest
# Author information
LABEL org.opencontainers.image.authors="CHAN Cheuk Long <clchan443-c@my.cityu.edu.hk>"
# Argument uses for representing image tags (without postfix)
ARG TAGNAME=undefined
# Install fundamental dependencies
RUN apk --no-cache upgrade
RUN apk --no-cache add nano gcc g++ make automake zsh unzip zip xz xz-dev mc curl bzip2 htop valgrind python3 py3-pip gdb
# Install legacy python and supporting dependencies
RUN apk --no-cache add musl-dev libffi-dev openssl-dev bzip2-dev zlib-dev sqlite-dev readline-dev gdbm-dev libxml2-dev libxslt-dev libjpeg-turbo-dev libpng-dev freetype-dev
ADD https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tar.xz /tmp/python2.tar.xz
RUN tar -xJf /tmp/python2.tar.xz -C /tmp && rm /tmp/python2.tar.xz
RUN cd /tmp/Python-2.7.18 && ./configure && make altinstall && make bininstall
RUN rm -rf /tmp/Python-2.7.18
RUN rm /usr/local/bin/python
# Install man pages and documentation files
RUN apk --no-cache add mandoc man-pages
COPY fetch_manpage.sh /opt/fetch_manpage.sh
RUN chmod +x /opt/fetch_manpage.sh
RUN /opt/fetch_manpage.sh
RUN rm /var/cache/apk/*
# Provide better zsh prompt
RUN echo 'PROMPT="%n@%m:%d> "' >> /etc/zsh/zshrc
# Assign image tag info
RUN echo "CS3103PICO_TAG=${TAGNAME}" >> /etc/os-release
# Invoke shell
CMD ["/bin/zsh"]