From 4f05a51eaafebe5c0a8b40a1a160eaf5949e8ebb Mon Sep 17 00:00:00 2001 From: Ash McKenzie Date: Thu, 15 Mar 2018 11:47:22 +1100 Subject: [PATCH 1/3] Use pip requirements.txt to ensure correct versions --- docker/Dockerfile | 5 ++++- docker/requirements.txt | 5 +++++ docker/update_and_run_gateone.py | 1 - 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 docker/requirements.txt diff --git a/docker/Dockerfile b/docker/Dockerfile index c1929340..92e0aeb0 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -52,7 +52,10 @@ RUN apt-get -y \ openssh-client && \ apt-get -y clean && \ apt-get -q -y autoremove -RUN pip install --upgrade futures tornado cssmin slimit psutil + +RUN pip install --upgrade pip +COPY requirements.txt /tmp/requirements.txt +RUN pip install -r /tmp/requirements.txt # Create the necessary directories, clone the repo, and install everything RUN mkdir -p /gateone/logs && \ diff --git a/docker/requirements.txt b/docker/requirements.txt new file mode 100644 index 00000000..bbe167c4 --- /dev/null +++ b/docker/requirements.txt @@ -0,0 +1,5 @@ +cssmin==0.2.* +futures==3.2.* +psutil==5.4.* +slimit==0.8.* +tornado==4.5.* diff --git a/docker/update_and_run_gateone.py b/docker/update_and_run_gateone.py index 31f77d99..2768ec74 100755 --- a/docker/update_and_run_gateone.py +++ b/docker/update_and_run_gateone.py @@ -38,7 +38,6 @@ print("Encountered a problem trying to install/upgrade Gate One...") print(output) sys.exit(1) - retcode, output = getstatusoutput('pip install --upgrade tornado') else: go_args.remove('--noupdate') os.execvp('/usr/bin/python', [ From 5ebfc2dd3b52c57dc052ffe835c6eaad23e41a0c Mon Sep 17 00:00:00 2001 From: Ash McKenzie Date: Thu, 15 Mar 2018 11:57:46 +1100 Subject: [PATCH 2/3] ENTRYPOINT over CMD to allow --noupdate to work --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 92e0aeb0..f5755bf9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -81,4 +81,4 @@ RUN rm -f /etc/gateone/ssl/key.pem && \ EXPOSE 8000 -CMD ["/usr/local/bin/update_and_run_gateone", "--log_file_prefix=/gateone/logs/gateone.log"] +ENTRYPOINT ["/usr/local/bin/update_and_run_gateone", "--log_file_prefix=/gateone/logs/gateone.log"] From b5ca47a0d30530234597bfffbc0ed8262714247d Mon Sep 17 00:00:00 2001 From: Ash McKenzie Date: Thu, 15 Mar 2018 11:57:55 +1100 Subject: [PATCH 3/3] Add Makefile for convenience --- docker/Makefile | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 docker/Makefile diff --git a/docker/Makefile b/docker/Makefile new file mode 100644 index 00000000..830887b8 --- /dev/null +++ b/docker/Makefile @@ -0,0 +1,2 @@ +build: + docker build -t gateone .