Docker image to execute apue examples (Advanced Programming in Unix Environment)
142
# Allow gdb debugging within docker container
$ docker run -it --rm --name apue --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --security-opt apparmor=unconfined thecuriouscoder/apue:v1.1 /bin/bash
FROM ubuntu:18.04
RUN apt-get update && \
apt-get install -y sudo vim less curl wget build-essential zlib1g-dev libbsd-dev gdb tree && \
apt-get clean
RUN apt-get install -y locales locales-all
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
# Do not exclude man pages & other documentation
RUN rm /etc/dpkg/dpkg.cfg.d/excludes
# Reinstall all currently installed packages in order to get the man pages back
RUN apt-get update && \
dpkg -l | grep ^ii | cut -d' ' -f3 | xargs apt-get install -y --reinstall && \
rm -r /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y man manpages-posix
RUN useradd -m -s /bin/bash matsuda
RUN echo 'matsuda:matsuda' | chpasswd
# Provide sudo privileges to new user
RUN usermod -aG sudo matsuda
# Switch to the new user
USER matsuda
# Switch the directory to home directory
WORKDIR /home/matsuda
# Set environment variables
ENV LANG=en_US.UTF-8
# Create .vim related directories
RUN mkdir /home/matsuda/.vim
RUN mkdir /home/matsuda/.vim/view
# Optional vim options
RUN echo "set expandtab" >> ~/.vimrc
RUN echo "set tabstop=4" >> ~/.vimrc
RUN echo "set shiftwidth=4" >> ~/.vimrc
RUN echo "set laststatus=2" >> ~/.vimrc
RUN echo "set statusline=%F\ %=L:%l/%L\ %c\ (%p%%)" >> ~/.vimrc
RUN echo ":highlight ExtraWhitespace ctermbg=red guibg=red" >> ~/.vimrc
RUN echo ":match ExtraWhitespace /\s\+$/" >> ~/.vimrc
RUN echo "highlight OverLength ctermbg=red ctermfg=white guibg=#592929" >> ~/.vimrc
RUN echo "match OverLength /\%81v.\+/" >> ~/.vimrc
# APUE binaries and libraries
RUN wget http://www.apuebook.com/src.3e.tar.gz && tar -zxf src.3e.tar.gz && cd apue.3e && make && cd -
RUN rm src.3e.tar.gz
RUN echo "For all APUE program compilation use:\n -I apue.3e/include -L apue.3e/lib/ -lapue" > GCC_INSTRUCTIONS_README
Content type
Image
Digest
Size
413.7 MB
Last updated
about 7 years ago
docker pull thecuriouscoder/apue:v1.1