-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Pasquale Africa
committed
Jul 20, 2021
1 parent
d2e2813
commit 9a5d794
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Build with: | ||
# docker build -t mk_build . --squash | ||
# | ||
# Retrieve build files with: | ||
# docker run -it mk_build | ||
# docker container list | ||
# docker cp <container_id>:/mk/mk-2021.0-toolchain.tar.gz . | ||
# docker cp <container_id>:/mk/mk-2021.0-base.tar.gz . | ||
# docker cp <container_id>:/mk/mk-2021.0-full.tar.gz . | ||
|
||
|
||
FROM debian:latest | ||
|
||
MAINTAINER [email protected] | ||
|
||
|
||
# Define variables. | ||
ENV HOME /root | ||
ENV mkPrefix /u/sw | ||
|
||
ENV mkRoot /mk | ||
ENV mkOutputBasename ${mkRoot}/mk-2021.0 | ||
|
||
ENV mkKeepBuildDir yes | ||
ENV mkFlags "--jobs=6 -v" | ||
|
||
|
||
# Install dependencies. | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update -y && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y build-essential python2 python3 \ | ||
gawk procps wget curl openssh-client p11-kit \ | ||
git rsync zip unzip | ||
|
||
|
||
# Clone repo. | ||
RUN git clone https://github.com/elauksap/mk.git ${mkRoot} | ||
|
||
|
||
# 1. Bootstrap | ||
WORKDIR ${mkRoot} | ||
RUN bootstrap/bootstrap ${mkPrefix} | ||
|
||
# 2. Toolchain | ||
WORKDIR ${mkRoot}/toolchains/gcc-glibc | ||
RUN make install mkFlags="${mkFlags}" | ||
RUN tar czvf ${mkOutputBasename}-toolchain.tar.gz ${mkPrefix} | ||
|
||
# Enable toolchain by default. | ||
SHELL ["/bin/bash", "-c"] | ||
RUN printf "\n# mk.\n\ | ||
source /u/sw/etc/profile\n\ | ||
module load gcc-glibc\n" >> ${HOME}/.bashrc | ||
|
||
# 3. Base | ||
WORKDIR ${mkRoot}/base | ||
RUN source ${HOME}/.bashrc && make install mkFlags="${mkFlags}" | ||
RUN tar czvf ${mkOutputBasename}-base.tar.gz ${mkPrefix} | ||
|
||
# 4. Packages | ||
WORKDIR ${mkRoot}/pkgs | ||
RUN source ${HOME}/.bashrc && make install mkFlags="${mkFlags}" | ||
RUN tar czvf ${mkOutputBasename}-full.tar.gz ${mkPrefix} | ||
|
||
|
||
# Set configuration variables. | ||
USER root | ||
WORKDIR ${HOME} |