<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">Thomas De Schampheleire <<a href="mailto:patrickdepinguin@gmail.com">patrickdepinguin@gmail.com</a>> schrieb am Di., 20. Juni 2017 um 21:57 Uhr:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Dominik,<br>
<br>
I took a look at your kallithea-docker repo because I would like to<br>
start using Docker to launch my Kallithea instances.<br>
<br>
I built an image based on your Dockerfile, but face a few problems<br>
with the kallithea-entry-point.sh script. For example, the syntax to<br>
create the config file now does not take the 'Kallithea' argument, so<br>
one change is:<br>
<br>
diff --git a/kallithea-entry-point.sh b/kallithea-entry-point.sh<br>
--- a/kallithea-entry-point.sh<br>
+++ b/kallithea-entry-point.sh<br>
@@ -23,7 +23,7 @@ function create_db {<br>
<br>
if [ "$2" == "serve" ]; then<br>
if [ ! -s $KALLITHEA_PATH/conf/kallithea.ini ]; then<br>
- gearbox make-config Kallithea $KALLITHEA_PATH/conf/kallithea.ini<br>
+ gearbox make-config $KALLITHEA_PATH/conf/kallithea.ini<br>
sed -i -e 's/host\s=\s127\.0\.0\.1/host = <a href="http://0.0.0.0/g" rel="noreferrer" target="_blank">0.0.0.0/g</a>'<br>
$KALLITHEA_PATH/conf/kallithea.ini<br>
fi<br>
<br>
Now, I noticed other issues in this file, that I will try to fix, but<br>
I wonder what is the most efficient way to work here. Right now, I am<br>
making changes in kallithea-entry-point.sh, rebuild the image, create<br>
container, check the logs to see if it's better, repeat. But I feel<br>
there must be a better way. Do you have some suggestions (I'm<br>
relatively new to Docker).<br>
<br>
<br>
Related to the Dockerfile itself, I reordered some blocks to attempt<br>
to improve layer cache usage when a new Kallithea version is desired.<br>
For example, the apt-get updates and the installation of dockerize are<br>
expected to be quite invariant, and could be added higher than the<br>
cloning of Kallithea which may change more often. Below my current<br>
diff, comments welcome.<br></blockquote><div>I'm afraid that will not help. You see, if you use a different REV argument, docker will rebuild the whole thing anyway. So AFAIK at the moment there is no way to use layer caching.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
diff --git a/Dockerfile b/Dockerfile<br>
--- a/Dockerfile<br>
+++ b/Dockerfile<br>
@@ -2,38 +2,49 @@ FROM python:2.7<br>
<br>
MAINTAINER Dominik Ruf <<a href="mailto:dominikruf@gmail.com" target="_blank">dominikruf@gmail.com</a>><br>
<br>
+ARG URL=<a href="https://kallithea-scm.org/repos/kallithea" rel="noreferrer" target="_blank">https://kallithea-scm.org/repos/kallithea</a><br>
+ARG REV=stable<br>
+ARG http_proxy=<br>
+ARG https_proxy=<br>
+<br>
ENV DEBIAN_FRONTEND=noninteractive<br>
ENV KALLITHEA_PATH /var/kallithea<br>
-ARG URL=<a href="https://kallithea-scm.org/repos/kallithea" rel="noreferrer" target="_blank">https://kallithea-scm.org/repos/kallithea</a><br>
-ARG REV=stable<br>
+ENV http_proxy=$http_proxy<br>
+ENV https_proxy=$https_proxy<br>
<br>
# add kallithea user<br>
RUN useradd -d $KALLITHEA_PATH -u 1000 -m -s /bin/bash kallithea<br>
<br>
-# get kalilteha sources<br>
+# install dockerize<br>
+RUN cd $KALLITHEA_PATH && \<br>
+ wget <a href="https://github.com/jwilder/dockerize/releases/download/v0.4.0/dockerize-linux-amd64-v0.4.0.tar.gz&&" rel="noreferrer" target="_blank">https://github.com/jwilder/dockerize/releases/download/v0.4.0/dockerize-linux-amd64-v0.4.0.tar.gz<br>
&&</a> \<br>
+ tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.4.0.tar.gz && \<br>
+ rm dockerize-linux-amd64-v0.4.0.tar.gz<br>
+<br>
+# install dependencies<br>
+RUN apt-get update && \<br>
+ apt-get install -y --no-install-recommends \<br>
+ python-dev \<br>
+ python-ldap \<br>
+ pwgen<br>
+<br>
+# get kallithea sources<br>
RUN mkdir -p $KALLITHEA_PATH/conf && \<br>
mkdir $KALLITHEA_PATH/repos && \<br>
hg clone $URL -r $REV $KALLITHEA_PATH/src && \<br>
rm -r $KALLITHEA_PATH/src/.hg && \<br>
chown -R kallithea $KALLITHEA_PATH<br>
<br>
-# install dependencies<br>
-RUN apt-get update && \<br>
- apt-get install -y --no-install-recommends \<br>
- python-dev \<br>
- python-ldap \<br>
- pwgen && \<br>
-<br>
- cd $KALLITHEA_PATH/src && \<br>
+RUN cd $KALLITHEA_PATH/src && \<br>
pip install --no-cache-dir --upgrade -e . && \<br>
pip install --no-cache-dir --upgrade \<br>
psycopg2 \<br>
mysql-python \<br>
hg-evolve && \<br>
python setup.py compile_catalog && \<br>
- chown -R kallithea $KALLITHEA_PATH && \<br>
+ chown -R kallithea $KALLITHEA_PATH<br>
<br>
- apt-get purge --auto-remove -y python-dev && \<br>
+RUN apt-get purge --auto-remove -y python-dev && \<br>
apt-get autoremove && \<br>
apt-get autoclean && \<br>
rm -rf /var/lib/apt/lists/*<br>
@@ -57,12 +68,6 @@ RUN if [ -f $KALLITHEA_PATH/src/kallithe<br>
rm -rf /var/lib/apt/lists/*; \<br>
fi<br>
<br>
-# install dockerize<br>
-RUN cd $KALLITHEA_PATH && \<br>
- wget <a href="https://github.com/jwilder/dockerize/releases/download/v0.4.0/dockerize-linux-amd64-v0.4.0.tar.gz&&" rel="noreferrer" target="_blank">https://github.com/jwilder/dockerize/releases/download/v0.4.0/dockerize-linux-amd64-v0.4.0.tar.gz<br>
&&</a> \<br>
- tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.4.0.tar.gz && \<br>
- rm dockerize-linux-amd64-v0.4.0.tar.gz<br>
-<br>
VOLUME $KALLITHEA_PATH/repos<br>
VOLUME $KALLITHEA_PATH/conf<br>
<br>
<br>
Thanks,<br>
Thomas<br>
</blockquote></div></div>