-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
4 changed files
with
122 additions
and
16 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
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,37 @@ | ||
FROM ubuntu:22.04 | ||
|
||
# Set an encoding to make things work smoothly. | ||
ENV LANG C.UTF-8 | ||
ENV LC_ALL C.UTF-8 | ||
|
||
# Add a timestamp for the build. Also, bust the cache. | ||
ADD http://worldtimeapi.org/api/ip /opt/docker/etc/timestamp | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get --yes -qq update \ | ||
&& apt-get --yes -qq upgrade \ | ||
&& apt-get --yes -qq install \ | ||
bzip2 \ | ||
cmake \ | ||
cpio \ | ||
curl \ | ||
g++ \ | ||
gcc \ | ||
git \ | ||
libeigen3-dev \ | ||
libidn11-dev \ | ||
libopenmpi-dev \ | ||
openmpi-bin \ | ||
python3 \ | ||
python-is-python3 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Run common commands | ||
COPY run_commands /opt/docker/bin/run_commands | ||
RUN /opt/docker/bin/run_commands | ||
|
||
ENV PATH $PATH:/root/.local/bin | ||
|
||
ENV LD_LIBRARY_PATH /root/.local/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} | ||
|
||
SHELL ["/bin/bash"] |
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,13 @@ | ||
#!/bin/bash | ||
|
||
# Tag the latest build with the short git sha. Push the tag in addition | ||
# to the "latest" tag already pushed. | ||
GIT_SHA_TAG=${SOURCE_COMMIT:0:12} | ||
docker tag $IMAGE_NAME $DOCKER_REPO:$GIT_SHA_TAG | ||
docker push $DOCKER_REPO:$GIT_SHA_TAG | ||
|
||
# Invoke all downstream build triggers. | ||
for url in $(echo $NEXT_BUILD_TRIGGERS | sed "s/,/ /g") | ||
do | ||
curl -X POST $url | ||
done |
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,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Create lucky group | ||
groupadd -g 32766 lucky | ||
|
||
# create user merzbow | ||
echo 'mightybuilder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | ||
# merzbow will have the same uid as the host, so the container can write | ||
# to mounted volumes | ||
# Adapted from https://denibertovic.com/posts/handling-permissions-with-docker-volumes/ | ||
USER_ID=${HOST_USER_ID:-9001} | ||
useradd --shell /bin/bash -u "$USER_ID" -G lucky -o -c "" -m merzbow | ||
export HOME=/home/merzbow | ||
export USER=merzbow | ||
export LOGNAME=merzbow | ||
export MAIL=/var/spool/mail/merzbow | ||
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/merzbow/bin | ||
chown -R merzbow:merzbow $HOME | ||
cp -R /etc/skel $HOME && chown -R merzbow:merzbow $HOME/skel && (ls -A1 $HOME/skel | xargs -I {} mv -n $HOME/skel/{} $HOME) && rm -Rf $HOME/skel | ||
cd $HOME || exit |