Skip to content

Commit aa7b5dc

Browse files
authored
Merge pull request #71 from occam-ra/dockerfile-libboost-and-repair
Dockerfile changes: add libboost and general fixes, add run.sh, move GitHub creds prompt to command-line option
2 parents cc1fd7c + 4253620 commit aa7b5dc

File tree

3 files changed

+18
-24
lines changed

3 files changed

+18
-24
lines changed

podman/Dockerfile

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,49 +7,43 @@ ENV DEBIAN_FRONTEND noninteractive
77
ENV DEBCONF_NONINTERACTIVE_SEEN true
88
RUN ln -sf /usr/share/zoneinfo/US/Pacific /etc/localtime
99

10-
# Set up build arguments
11-
ARG GITHUB_USERNAME
12-
ARG GITHUB_EMAIL
13-
ARG GITHUB_PRIVATE_KEY
14-
1510
RUN apt-get update
1611
RUN apt install -y tzdata
1712
RUN dpkg-reconfigure -f noninteractive tzdata
1813
# We can run apache2 inside the container and start it as a service
1914
RUN apt install -y apache2
2015
# Maybe this can be trimmed. It was the standard suggested package list.
2116
RUN apt install -y git gcc build-essential libgmp3-dev python-dev libxml2 libxml2-dev zlib1g-dev python-pip
22-
2317
RUN apt install -y libtool autoconf bison flex
24-
RUN apt-get update && \
25-
apt-get install -y git vim openssh-client && \
26-
rm -rf /var/lib/apt/lists/*
27-
18+
RUN apt install -y git vim openssh-client
19+
RUN apt install -y libboost-math-dev
2820
# Set up build arguments with default values
29-
ARG GITHUB_USERNAME=""
30-
ARG GITHUB_EMAIL=""
31-
ARG GITHUB_PRIVATE_KEY=""
21+
ARG GITHUB_USERNAME
22+
ARG GITHUB_EMAIL
23+
ARG GITHUB_PRIVATE_KEY
24+
25+
WORKDIR /var/www
3226

3327
# Maybe checkout something better than HEAD?
3428
RUN git clone https://github.com/occam-ra/occam.git
3529

30+
WORKDIR occam
31+
3632
# Configure git with the build arguments if provided
3733
RUN if [ -n "$GITHUB_USERNAME" ] && [ -n "$GITHUB_EMAIL" ]; then \
3834
git config --global user.name "$GITHUB_USERNAME" && \
39-
git config --global user.email "$GITHUB_EMAIL"; \
40-
git remote set-url origin [email protected]:occam-ra/occam.git;\
35+
git config --global user.email "$GITHUB_EMAIL" && \
36+
git remote set-url origin [email protected]:occam-ra/occam.git; \
4137
fi
4238

4339
# Create the .ssh directory and copy the private key if provided
4440
RUN if [ -n "$GITHUB_PRIVATE_KEY" ]; then \
4541
mkdir -p /root/.ssh && \
46-
echo "$GITHUB_PRIVATE_KEY" > /root/.ssh/id_rsa && \
47-
chmod 600 /root/.ssh/id_rsa && \
48-
echo "Host github.com\n IdentityFile /root/.ssh/id_rsa" > /root/.ssh/config; \
42+
echo "$GITHUB_PRIVATE_KEY" > /root/.ssh/id_github && \
43+
chmod 600 /root/.ssh/id_github && \
44+
echo "Host github.com\n IdentityFile /root/.ssh/id_github" > /root/.ssh/config; \
4945
fi
5046

51-
52-
WORKDIR occam
5347
# Install igraph
5448
RUN pip install python-igraph==0.8.0
5549

podman/build.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#!/bin/bash
22

3-
# Prompt the user if they want to enter GitHub details
4-
read -p "Do you want to enter your GitHub details? (y/n): " ENTER_GITHUB
5-
6-
if [[ $ENTER_GITHUB =~ ^[Yy]$ ]]; then
3+
if [[ "$1" == "--github" ]]; then
74
# Prompt the user for input
85
read -p "Enter your GitHub username: " GITHUB_USERNAME
96
read -p "Enter your GitHub email: " GITHUB_EMAIL

podman/run.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
podman run -d -p 8080:80 occam_local
3+
echo "You can now connect at http://localhost:8080/"

0 commit comments

Comments
 (0)