From ca4ed0d864cc435680b91583bc57256a7c0ef007 Mon Sep 17 00:00:00 2001 From: Johan Berggren Date: Fri, 15 May 2020 11:46:34 +0200 Subject: [PATCH 01/19] Docker refactor --- .../Dockerfile => build/Dockerfile-dev} | 0 docker/{factory => build}/README.md | 0 docker/{development => dev}/Dockerfile | 0 docker/{development => dev}/README.md | 0 .../{development => dev}/docker-compose.yml | 0 .../{development => dev}/docker-entrypoint.sh | 0 docker/{ => e2e}/Dockerfile | 11 +++----- docker/{ => e2e}/docker-compose.yml | 26 +++++++------------ docker/{ => e2e}/docker-entrypoint.sh | 0 9 files changed, 13 insertions(+), 24 deletions(-) rename docker/{factory/development/Dockerfile => build/Dockerfile-dev} (100%) rename docker/{factory => build}/README.md (100%) rename docker/{development => dev}/Dockerfile (100%) rename docker/{development => dev}/README.md (100%) rename docker/{development => dev}/docker-compose.yml (100%) rename docker/{development => dev}/docker-entrypoint.sh (100%) rename docker/{ => e2e}/Dockerfile (76%) rename docker/{ => e2e}/docker-compose.yml (82%) rename docker/{ => e2e}/docker-entrypoint.sh (100%) diff --git a/docker/factory/development/Dockerfile b/docker/build/Dockerfile-dev similarity index 100% rename from docker/factory/development/Dockerfile rename to docker/build/Dockerfile-dev diff --git a/docker/factory/README.md b/docker/build/README.md similarity index 100% rename from docker/factory/README.md rename to docker/build/README.md diff --git a/docker/development/Dockerfile b/docker/dev/Dockerfile similarity index 100% rename from docker/development/Dockerfile rename to docker/dev/Dockerfile diff --git a/docker/development/README.md b/docker/dev/README.md similarity index 100% rename from docker/development/README.md rename to docker/dev/README.md diff --git a/docker/development/docker-compose.yml b/docker/dev/docker-compose.yml similarity index 100% rename from docker/development/docker-compose.yml rename to docker/dev/docker-compose.yml diff --git a/docker/development/docker-entrypoint.sh b/docker/dev/docker-entrypoint.sh similarity index 100% rename from docker/development/docker-entrypoint.sh rename to docker/dev/docker-entrypoint.sh diff --git a/docker/Dockerfile b/docker/e2e/Dockerfile similarity index 76% rename from docker/Dockerfile rename to docker/e2e/Dockerfile index d4ab0a4d61..55e3fcdeb7 100644 --- a/docker/Dockerfile +++ b/docker/e2e/Dockerfile @@ -1,11 +1,8 @@ # Use the official Docker Hub Ubuntu 18.04 base image FROM ubuntu:18.04 -# Update the base image -RUN apt-get update && apt-get -y upgrade && apt-get -y dist-upgrade - # Setup install environment and Timesketch dependencies -RUN apt-get --no-install-recommends -y install apt-transport-https \ +RUN apt-get update && apt-get -y install apt-transport-https \ apt-utils \ ca-certificates \ git \ @@ -16,9 +13,9 @@ RUN apt-get --no-install-recommends -y install apt-transport-https \ python3-psycopg2 # Install Plaso, nodejs and yarn. -RUN apt-get --no-install-recommends -y install software-properties-common +RUN apt-get -y install software-properties-common RUN add-apt-repository ppa:gift/stable && apt-get update -RUN apt-get update && apt-get --no-install-recommends -y install plaso-tools +RUN apt-get update && apt-get -y install plaso-tools # Use Python 3 pip (pip3) to install Timesketch RUN pip3 install timesketch @@ -31,7 +28,7 @@ RUN cp /tmp/timesketch/data/features.yaml /etc/timesketch/ RUN cp /tmp/timesketch/data/sigma_config.yaml /etc/timesketch/ # Copy the entrypoint script into the container -COPY docker/docker-entrypoint.sh / +COPY docker/e2e/docker-entrypoint.sh / RUN chmod a+x /docker-entrypoint.sh # Expose the port used by Timesketch diff --git a/docker/docker-compose.yml b/docker/e2e/docker-compose.yml similarity index 82% rename from docker/docker-compose.yml rename to docker/e2e/docker-compose.yml index 94bf876292..4c9bdb6ebd 100644 --- a/docker/docker-compose.yml +++ b/docker/e2e/docker-compose.yml @@ -1,15 +1,6 @@ version: '3' services: timesketch: - build: - context: ../ - dockerfile: ./docker/Dockerfile - ports: - - "80:80" - links: - - elasticsearch - - postgres - - redis environment: - POSTGRES_USER=timesketch - POSTGRES_PASSWORD=password @@ -21,12 +12,20 @@ services: - REDIS_PORT=6379 - TIMESKETCH_USER=${TIMESKETCH_USER} - TIMESKETCH_PASSWORD=${TIMESKETCH_PASSWORD} + build: + context: ../../ + dockerfile: ./docker/e2e/Dockerfile + ports: + - "80:80" + links: + - elasticsearch + - postgres + - redis restart: always volumes: - ../:/usr/local/src/timesketch/ elasticsearch: - environment: - TAKE_FILE_OWNERSHIP=1 - discovery.type=single-node @@ -38,8 +37,6 @@ services: - "9200:9200" - "9300:9300" restart: always - volumes: - - /var/lib/elasticsearch:/usr/share/elasticsearch/data postgres: image: postgres @@ -49,12 +46,7 @@ services: - POSTGRES_USER=timesketch - POSTGRES_PASSWORD=password restart: always - volumes: - - /var/lib/postgresql/data:/var/lib/postgresql/data - redis: image: redis restart: always - volumes: - - /var/lib/redis:/data diff --git a/docker/docker-entrypoint.sh b/docker/e2e/docker-entrypoint.sh similarity index 100% rename from docker/docker-entrypoint.sh rename to docker/e2e/docker-entrypoint.sh From 2a5802c04121c3d6b5d1f9f8e84072421626590d Mon Sep 17 00:00:00 2001 From: Johan Berggren Date: Fri, 15 May 2020 13:23:43 +0200 Subject: [PATCH 02/19] Docker refactor --- docker/e2e/Dockerfile | 30 ++++++++++++++++-------------- docker/e2e/docker-compose.yml | 2 +- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/docker/e2e/Dockerfile b/docker/e2e/Dockerfile index 55e3fcdeb7..2adce97325 100644 --- a/docker/e2e/Dockerfile +++ b/docker/e2e/Dockerfile @@ -1,21 +1,23 @@ # Use the official Docker Hub Ubuntu 18.04 base image FROM ubuntu:18.04 +# Add Plaso PPA repository +RUN add-apt-repository ppa:gift/stable + # Setup install environment and Timesketch dependencies -RUN apt-get update && apt-get -y install apt-transport-https \ - apt-utils \ - ca-certificates \ - git \ - libffi-dev \ - lsb-release \ - python3-dev \ - python3-pip \ - python3-psycopg2 - -# Install Plaso, nodejs and yarn. -RUN apt-get -y install software-properties-common -RUN add-apt-repository ppa:gift/stable && apt-get update -RUN apt-get update && apt-get -y install plaso-tools +RUN apt-get update && apt-get -y install \ + apt-transport-https \ + apt-utils \ + ca-certificates \ + git \ + libffi-dev \ + lsb-release \ + software-properties-common \ + python3-dev \ + python3-pip \ + python3-psycopg2 \ + plaso-tools \ + && rm -rf /var/lib/apt/lists/* # Use Python 3 pip (pip3) to install Timesketch RUN pip3 install timesketch diff --git a/docker/e2e/docker-compose.yml b/docker/e2e/docker-compose.yml index 4c9bdb6ebd..e37a028cde 100644 --- a/docker/e2e/docker-compose.yml +++ b/docker/e2e/docker-compose.yml @@ -23,7 +23,7 @@ services: - redis restart: always volumes: - - ../:/usr/local/src/timesketch/ + - ../../:/usr/local/src/timesketch/ elasticsearch: environment: From 790f397b39b71bd61a5f98bd4f6c341483505de6 Mon Sep 17 00:00:00 2001 From: Johan Berggren Date: Fri, 15 May 2020 13:28:31 +0200 Subject: [PATCH 03/19] Docker refactor --- docker/e2e/Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docker/e2e/Dockerfile b/docker/e2e/Dockerfile index 2adce97325..0b2c09f575 100644 --- a/docker/e2e/Dockerfile +++ b/docker/e2e/Dockerfile @@ -1,9 +1,6 @@ # Use the official Docker Hub Ubuntu 18.04 base image FROM ubuntu:18.04 -# Add Plaso PPA repository -RUN add-apt-repository ppa:gift/stable - # Setup install environment and Timesketch dependencies RUN apt-get update && apt-get -y install \ apt-transport-https \ @@ -16,6 +13,11 @@ RUN apt-get update && apt-get -y install \ python3-dev \ python3-pip \ python3-psycopg2 \ + && rm -rf /var/lib/apt/lists/* + +# Install Plaso +RUN add-apt-repository ppa:gift/stable +RUN apt-get update && apt-get -y install \ plaso-tools \ && rm -rf /var/lib/apt/lists/* From 0d656761923546fa572fee7a94ce407c660094e8 Mon Sep 17 00:00:00 2001 From: Johan Berggren Date: Fri, 15 May 2020 13:38:33 +0200 Subject: [PATCH 04/19] Docker refactor --- docker/dev/README.md | 2 +- docker/{ => e2e}/README.md | 8 ++------ docker/prod/README.md | 3 +++ 3 files changed, 6 insertions(+), 7 deletions(-) rename docker/{ => e2e}/README.md (94%) create mode 100644 docker/prod/README.md diff --git a/docker/dev/README.md b/docker/dev/README.md index d9db95a5d7..b563139655 100644 --- a/docker/dev/README.md +++ b/docker/dev/README.md @@ -1,4 +1,4 @@ -## Development +## Docker for development You can run Timesketch on Docker in development mode. diff --git a/docker/README.md b/docker/e2e/README.md similarity index 94% rename from docker/README.md rename to docker/e2e/README.md index e7ef7035f4..05854b84d2 100644 --- a/docker/README.md +++ b/docker/e2e/README.md @@ -1,7 +1,6 @@ -# Docker +# Docker for e2e tests Timesketch has support for Docker. This is a convenient way of getting up and running. - NOTE: Windows based host systems are not supported at this time. ### Install Docker @@ -22,7 +21,7 @@ Follow the official instructions [here](https://www.elastic.co/guide/en/elastics ### Build and Start Containers ```shell -cd docker +cd docker/e2e sudo docker-compose up ``` @@ -40,7 +39,6 @@ sudo docker-compose up The timesketch docker config is set to write all data to the host filesystem, not the containers. This is accomplished with docker [volumes](https://docs.docker.com/engine/admin/volumes/volumes/) that map to the following locations: - elasticsearch: /var/lib/elasticsearch -- neo4j: /var/lib/neo4j/data - postgres: /var/lib/postgresql - redis: /var/lib/redis @@ -49,8 +47,6 @@ The timesketch docker config is set to write all data to the host filesystem, no On mac, you can set up the shares as following ```shell -sudo mkdir -p /var/lib/neo4j/data -sudo chown `whoami` /var/lib/neo4j/data sudo mkdir -p /var/lib/elasticsearch sudo chown `whoami` /var/lib/elasticsearch sudo mkdir -p /var/lib/postgresql/data diff --git a/docker/prod/README.md b/docker/prod/README.md new file mode 100644 index 0000000000..ea03d52264 --- /dev/null +++ b/docker/prod/README.md @@ -0,0 +1,3 @@ +# Docker for production + +Production ready setup is not yet implemented. \ No newline at end of file From 1ce248757d6e86deabb714111d5f330238f16eda Mon Sep 17 00:00:00 2001 From: Johan Berggren Date: Fri, 15 May 2020 14:13:25 +0200 Subject: [PATCH 05/19] Cloud Build --- cloudbuild.yaml | 5 +++++ docker/dev/Dockerfile | 2 +- docker/dev/docker-compose.yml | 8 -------- docker/dev/docker-entrypoint.sh | 10 ---------- 4 files changed, 6 insertions(+), 19 deletions(-) create mode 100644 cloudbuild.yaml diff --git a/cloudbuild.yaml b/cloudbuild.yaml new file mode 100644 index 0000000000..b7804a91bc --- /dev/null +++ b/cloudbuild.yaml @@ -0,0 +1,5 @@ +steps: +- name: 'gcr.io/cloud-builders/docker' + args: [ 'build', '-t', 'gcr.io/timesketch-demo/timesketch', '.' ] +images: +- 'gcr.io/timesketch-demo/timesketch' \ No newline at end of file diff --git a/docker/dev/Dockerfile b/docker/dev/Dockerfile index 9865b1a170..ad17e55df9 100644 --- a/docker/dev/Dockerfile +++ b/docker/dev/Dockerfile @@ -1,5 +1,5 @@ # Use the latest Timesketch development base image -FROM timesketch/timesketch-dev-base:20191128 +FROM timesketch/timesketch-dev-base:20200327 # Install dependencies for Timesketch COPY requirements.txt /timesketch-requirements.txt diff --git a/docker/dev/docker-compose.yml b/docker/dev/docker-compose.yml index 8e0e1dd213..3f99ee646a 100644 --- a/docker/dev/docker-compose.yml +++ b/docker/dev/docker-compose.yml @@ -19,8 +19,6 @@ services: - ELASTIC_PORT=9200 - REDIS_ADDRESS=redis - REDIS_PORT=6379 - - NEO4J_ADDRESS=neo4j - - NEO4J_PORT=7474 - TIMESKETCH_USER=dev - TIMESKETCH_PASSWORD=dev - CHOKIDAR_USEPOLLING=true @@ -51,9 +49,3 @@ services: redis: image: redis restart: always - - neo4j: - image: neo4j - environment: - - NEO4J_AUTH=none - restart: always diff --git a/docker/dev/docker-entrypoint.sh b/docker/dev/docker-entrypoint.sh index 59237cd0e0..afc8c02b89 100644 --- a/docker/dev/docker-entrypoint.sh +++ b/docker/dev/docker-entrypoint.sh @@ -49,16 +49,6 @@ if [ "$1" = 'timesketch' ]; then echo "Please pass values for the REDIS_ADDRESS and REDIS_PORT environment variables" fi - # Set up the Neo4j connection - if [ $NEO4J_ADDRESS ] && [ $NEO4J_PORT ]; then - sed -i 's#GRAPH_BACKEND_ENABLED = False#GRAPH_BACKEND_ENABLED = True#' /etc/timesketch/timesketch.conf - sed -i 's#NEO4J_HOST =.*#NEO4J_HOST = \x27'$NEO4J_ADDRESS'\x27#' /etc/timesketch/timesketch.conf - sed -i 's#NEO4J_PORT =.*#NEO4J_PORT = '$NEO4J_PORT'#' /etc/timesketch/timesketch.conf - else - # Log an error since we need the above-listed environment variables - echo "Please pass values for the NEO4J_ADDRESS and NEO4J_PORT environment variables if you want graph support" - fi - # Enable debug for the development server sed -i s/"DEBUG = False"/"DEBUG = True"/ /etc/timesketch/timesketch.conf From 788dde0ce2167e192743f4549090a7d39b21893e Mon Sep 17 00:00:00 2001 From: Johan Berggren Date: Fri, 15 May 2020 14:24:05 +0200 Subject: [PATCH 06/19] Cloud Build --- cloudbuild.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/cloudbuild.yaml b/cloudbuild.yaml index b7804a91bc..e9b941fa13 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -1,5 +1,6 @@ steps: - name: 'gcr.io/cloud-builders/docker' args: [ 'build', '-t', 'gcr.io/timesketch-demo/timesketch', '.' ] + dir: 'docker/e2e/' images: - 'gcr.io/timesketch-demo/timesketch' \ No newline at end of file From c78b887be25a2e21b33fd2a1d9fb63b51f93a939 Mon Sep 17 00:00:00 2001 From: Johan Berggren Date: Fri, 15 May 2020 14:36:59 +0200 Subject: [PATCH 07/19] Cloud Build --- cloudbuild.yaml | 2 +- docker/build/Dockerfile | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 docker/build/Dockerfile diff --git a/cloudbuild.yaml b/cloudbuild.yaml index e9b941fa13..69cb493578 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -1,6 +1,6 @@ steps: - name: 'gcr.io/cloud-builders/docker' args: [ 'build', '-t', 'gcr.io/timesketch-demo/timesketch', '.' ] - dir: 'docker/e2e/' + dir: 'docker/build/' images: - 'gcr.io/timesketch-demo/timesketch' \ No newline at end of file diff --git a/docker/build/Dockerfile b/docker/build/Dockerfile new file mode 100644 index 0000000000..6f370bf39f --- /dev/null +++ b/docker/build/Dockerfile @@ -0,0 +1,25 @@ +# Use the official Docker Hub Ubuntu 18.04 base image +FROM ubuntu:18.04 + +# Setup install environment and Timesketch dependencies +RUN apt-get update && apt-get -y install \ + apt-transport-https \ + apt-utils \ + ca-certificates \ + git \ + libffi-dev \ + lsb-release \ + software-properties-common \ + python3-dev \ + python3-pip \ + python3-psycopg2 \ + && rm -rf /var/lib/apt/lists/* + +# Install Plaso +RUN add-apt-repository ppa:gift/stable +RUN apt-get update && apt-get -y install \ + plaso-tools \ + && rm -rf /var/lib/apt/lists/* + +# Use Python 3 pip (pip3) to install Timesketch +RUN pip3 install timesketch From f3c83a51ab4d711d2934413f303171ced881910d Mon Sep 17 00:00:00 2001 From: Johan Berggren Date: Fri, 15 May 2020 14:50:40 +0200 Subject: [PATCH 08/19] Cloud Build --- cloudbuild.yaml => docker/build/cloudbuild.yaml | 1 - 1 file changed, 1 deletion(-) rename cloudbuild.yaml => docker/build/cloudbuild.yaml (87%) diff --git a/cloudbuild.yaml b/docker/build/cloudbuild.yaml similarity index 87% rename from cloudbuild.yaml rename to docker/build/cloudbuild.yaml index 69cb493578..b7804a91bc 100644 --- a/cloudbuild.yaml +++ b/docker/build/cloudbuild.yaml @@ -1,6 +1,5 @@ steps: - name: 'gcr.io/cloud-builders/docker' args: [ 'build', '-t', 'gcr.io/timesketch-demo/timesketch', '.' ] - dir: 'docker/build/' images: - 'gcr.io/timesketch-demo/timesketch' \ No newline at end of file From d9ccb5f06e5663588d1dfd11643f0fb78f0a4d33 Mon Sep 17 00:00:00 2001 From: Johan Berggren Date: Fri, 15 May 2020 14:57:35 +0200 Subject: [PATCH 09/19] Cloud Build --- docker/build/{Dockerfile => Dockerfile-prod} | 0 docker/build/cloudbuild.yaml | 5 ----- 2 files changed, 5 deletions(-) rename docker/build/{Dockerfile => Dockerfile-prod} (100%) delete mode 100644 docker/build/cloudbuild.yaml diff --git a/docker/build/Dockerfile b/docker/build/Dockerfile-prod similarity index 100% rename from docker/build/Dockerfile rename to docker/build/Dockerfile-prod diff --git a/docker/build/cloudbuild.yaml b/docker/build/cloudbuild.yaml deleted file mode 100644 index b7804a91bc..0000000000 --- a/docker/build/cloudbuild.yaml +++ /dev/null @@ -1,5 +0,0 @@ -steps: -- name: 'gcr.io/cloud-builders/docker' - args: [ 'build', '-t', 'gcr.io/timesketch-demo/timesketch', '.' ] -images: -- 'gcr.io/timesketch-demo/timesketch' \ No newline at end of file From 345c95c4815c93cd987756f36eccee875a53d784 Mon Sep 17 00:00:00 2001 From: Johan Berggren Date: Fri, 15 May 2020 15:38:37 +0200 Subject: [PATCH 10/19] Cloud Build --- docker/build/cloudbuild.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docker/build/cloudbuild.yaml diff --git a/docker/build/cloudbuild.yaml b/docker/build/cloudbuild.yaml new file mode 100644 index 0000000000..4309dda457 --- /dev/null +++ b/docker/build/cloudbuild.yaml @@ -0,0 +1,5 @@ +steps: +- name: 'gcr.io/cloud-builders/docker' + args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/releases', '.' ] + dir: 'docker/build/' +images: ['gcr.io/$PROJECT_ID/timesketch:$TAG_NAME', 'gcr.io/$PROJECT_ID/timesketch:latest'] From 937d798f3c39b27db3c36fcf2f9d0844a7ea2224 Mon Sep 17 00:00:00 2001 From: Johan Berggren Date: Fri, 15 May 2020 15:40:17 +0200 Subject: [PATCH 11/19] Cloud Build --- docker/build/cloudbuild.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/build/cloudbuild.yaml b/docker/build/cloudbuild.yaml index 4309dda457..4780c79f72 100644 --- a/docker/build/cloudbuild.yaml +++ b/docker/build/cloudbuild.yaml @@ -1,5 +1,5 @@ steps: - name: 'gcr.io/cloud-builders/docker' - args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/releases', '.' ] + args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/releases', 'Dockerfile-prod' ] dir: 'docker/build/' images: ['gcr.io/$PROJECT_ID/timesketch:$TAG_NAME', 'gcr.io/$PROJECT_ID/timesketch:latest'] From 5261e35422d880cff5799f058876c1f61faee9a5 Mon Sep 17 00:00:00 2001 From: Johan Berggren Date: Fri, 15 May 2020 15:46:52 +0200 Subject: [PATCH 12/19] Cloud Build --- docker/build/cloudbuild.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/build/cloudbuild.yaml b/docker/build/cloudbuild.yaml index 4780c79f72..1925c0ea8f 100644 --- a/docker/build/cloudbuild.yaml +++ b/docker/build/cloudbuild.yaml @@ -1,5 +1,5 @@ steps: - name: 'gcr.io/cloud-builders/docker' - args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/releases', 'Dockerfile-prod' ] + args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/release', '-f' 'Dockerfile-prod' '.' ] dir: 'docker/build/' -images: ['gcr.io/$PROJECT_ID/timesketch:$TAG_NAME', 'gcr.io/$PROJECT_ID/timesketch:latest'] +images: ['gcr.io/$PROJECT_ID/release/timesketch:$TAG_NAME', 'gcr.io/$PROJECT_ID/release/timesketch:latest'] From b251e2c737c53c93e5b24899d880cc224acc30ca Mon Sep 17 00:00:00 2001 From: Johan Berggren Date: Fri, 15 May 2020 15:47:55 +0200 Subject: [PATCH 13/19] Cloud Build --- docker/build/cloudbuild.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/build/cloudbuild.yaml b/docker/build/cloudbuild.yaml index 1925c0ea8f..bbe7eda701 100644 --- a/docker/build/cloudbuild.yaml +++ b/docker/build/cloudbuild.yaml @@ -1,5 +1,5 @@ steps: - name: 'gcr.io/cloud-builders/docker' - args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/release', '-f' 'Dockerfile-prod' '.' ] + args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/release', '-f', 'Dockerfile-prod', '.' ] dir: 'docker/build/' images: ['gcr.io/$PROJECT_ID/release/timesketch:$TAG_NAME', 'gcr.io/$PROJECT_ID/release/timesketch:latest'] From 754ae87a7024c0e08f2dbc47350f360737470957 Mon Sep 17 00:00:00 2001 From: Johan Berggren Date: Fri, 15 May 2020 15:59:08 +0200 Subject: [PATCH 14/19] Cloud Build --- docker/build/cloudbuild.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/build/cloudbuild.yaml b/docker/build/cloudbuild.yaml index bbe7eda701..d08128eb89 100644 --- a/docker/build/cloudbuild.yaml +++ b/docker/build/cloudbuild.yaml @@ -2,4 +2,4 @@ steps: - name: 'gcr.io/cloud-builders/docker' args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/release', '-f', 'Dockerfile-prod', '.' ] dir: 'docker/build/' -images: ['gcr.io/$PROJECT_ID/release/timesketch:$TAG_NAME', 'gcr.io/$PROJECT_ID/release/timesketch:latest'] +images: ['gcr.io/$PROJECT_ID/release/timesketch:$_TAG_NAME', 'gcr.io/$PROJECT_ID/release/timesketch:latest'] From 6f75aa88e2ad1b3bf36c2700f4aa3643346a3355 Mon Sep 17 00:00:00 2001 From: Johan Berggren Date: Fri, 15 May 2020 16:11:12 +0200 Subject: [PATCH 15/19] Cloud Build --- docker/build/cloudbuild.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker/build/cloudbuild.yaml b/docker/build/cloudbuild.yaml index d08128eb89..d0294d369e 100644 --- a/docker/build/cloudbuild.yaml +++ b/docker/build/cloudbuild.yaml @@ -2,4 +2,6 @@ steps: - name: 'gcr.io/cloud-builders/docker' args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/release', '-f', 'Dockerfile-prod', '.' ] dir: 'docker/build/' -images: ['gcr.io/$PROJECT_ID/release/timesketch:$_TAG_NAME', 'gcr.io/$PROJECT_ID/release/timesketch:latest'] +images: +- 'gcr.io/$PROJECT_ID/release/timesketch:$TAG_NAME', + 'gcr.io/$PROJECT_ID/release/timesketch:latest' From 5016c30b90f0097e14adfff7c0e2e3fcc1c40a14 Mon Sep 17 00:00:00 2001 From: Johan Berggren Date: Fri, 15 May 2020 16:13:29 +0200 Subject: [PATCH 16/19] Cloud Build --- docker/build/cloudbuild.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docker/build/cloudbuild.yaml b/docker/build/cloudbuild.yaml index d0294d369e..bbe7eda701 100644 --- a/docker/build/cloudbuild.yaml +++ b/docker/build/cloudbuild.yaml @@ -2,6 +2,4 @@ steps: - name: 'gcr.io/cloud-builders/docker' args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/release', '-f', 'Dockerfile-prod', '.' ] dir: 'docker/build/' -images: -- 'gcr.io/$PROJECT_ID/release/timesketch:$TAG_NAME', - 'gcr.io/$PROJECT_ID/release/timesketch:latest' +images: ['gcr.io/$PROJECT_ID/release/timesketch:$TAG_NAME', 'gcr.io/$PROJECT_ID/release/timesketch:latest'] From 08cd88f23e46eb65fb357008afd20113a72f5c1b Mon Sep 17 00:00:00 2001 From: Johan Berggren Date: Fri, 15 May 2020 16:19:19 +0200 Subject: [PATCH 17/19] Cloud Build --- docker/build/cloudbuild.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/build/cloudbuild.yaml b/docker/build/cloudbuild.yaml index bbe7eda701..bb4bcc8608 100644 --- a/docker/build/cloudbuild.yaml +++ b/docker/build/cloudbuild.yaml @@ -1,5 +1,5 @@ steps: - name: 'gcr.io/cloud-builders/docker' - args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/release', '-f', 'Dockerfile-prod', '.' ] + args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/release/timesketch', '-f', 'Dockerfile-prod', '.' ] dir: 'docker/build/' images: ['gcr.io/$PROJECT_ID/release/timesketch:$TAG_NAME', 'gcr.io/$PROJECT_ID/release/timesketch:latest'] From abacc79630671e9636f009975e3d400a19dd9f97 Mon Sep 17 00:00:00 2001 From: Johan Berggren Date: Fri, 15 May 2020 16:28:30 +0200 Subject: [PATCH 18/19] Cloud Build --- docker/build/Dockerfile-prod | 2 +- docker/build/cloudbuild.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/build/Dockerfile-prod b/docker/build/Dockerfile-prod index 6f370bf39f..344407353a 100644 --- a/docker/build/Dockerfile-prod +++ b/docker/build/Dockerfile-prod @@ -22,4 +22,4 @@ RUN apt-get update && apt-get -y install \ && rm -rf /var/lib/apt/lists/* # Use Python 3 pip (pip3) to install Timesketch -RUN pip3 install timesketch +RUN pip3 install https://github.com/google/timesketch/archive/master.zip diff --git a/docker/build/cloudbuild.yaml b/docker/build/cloudbuild.yaml index bb4bcc8608..14cb6837a2 100644 --- a/docker/build/cloudbuild.yaml +++ b/docker/build/cloudbuild.yaml @@ -1,5 +1,5 @@ steps: - name: 'gcr.io/cloud-builders/docker' - args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/release/timesketch', '-f', 'Dockerfile-prod', '.' ] + args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/release/timesketch:latest', '-t', 'gcr.io/$PROJECT_ID/release/timesketch:$TAG_NAME', '-f', 'Dockerfile-prod', '.' ] dir: 'docker/build/' -images: ['gcr.io/$PROJECT_ID/release/timesketch:$TAG_NAME', 'gcr.io/$PROJECT_ID/release/timesketch:latest'] +images: ['gcr.io/$PROJECT_ID/release/timesketch:latest', 'gcr.io/$PROJECT_ID/release/timesketch:$TAG_NAME'] From 2845175333fa066961705d7d2882263d270572d6 Mon Sep 17 00:00:00 2001 From: Johan Berggren Date: Wed, 20 May 2020 13:16:39 +0200 Subject: [PATCH 19/19] Use gcr.io imaghes --- docker/dev/Dockerfile | 4 ++-- docker/dev/docker-compose.yml | 2 +- docker/e2e/Dockerfile | 26 +------------------------- 3 files changed, 4 insertions(+), 28 deletions(-) diff --git a/docker/dev/Dockerfile b/docker/dev/Dockerfile index ad17e55df9..190dd7b0fb 100644 --- a/docker/dev/Dockerfile +++ b/docker/dev/Dockerfile @@ -1,12 +1,12 @@ # Use the latest Timesketch development base image -FROM timesketch/timesketch-dev-base:20200327 +FROM gcr.io/timesketch-build/dev/timesketch-dev-base:latest # Install dependencies for Timesketch COPY requirements.txt /timesketch-requirements.txt RUN pip3 install -r /timesketch-requirements.txt # Copy the entrypoint script into the container -COPY docker/development/docker-entrypoint.sh /docker-entrypoint.sh +COPY docker/dev/docker-entrypoint.sh /docker-entrypoint.sh RUN chmod a+x /docker-entrypoint.sh # Load the entrypoint script to be run later diff --git a/docker/dev/docker-compose.yml b/docker/dev/docker-compose.yml index 3f99ee646a..bb2c462805 100644 --- a/docker/dev/docker-compose.yml +++ b/docker/dev/docker-compose.yml @@ -3,7 +3,7 @@ services: timesketch: build: context: ../../ - dockerfile: ./docker/development/Dockerfile + dockerfile: ./docker/dev/Dockerfile ports: - "127.0.0.1:5000:5000" links: diff --git a/docker/e2e/Dockerfile b/docker/e2e/Dockerfile index 0b2c09f575..4b85447350 100644 --- a/docker/e2e/Dockerfile +++ b/docker/e2e/Dockerfile @@ -1,28 +1,4 @@ -# Use the official Docker Hub Ubuntu 18.04 base image -FROM ubuntu:18.04 - -# Setup install environment and Timesketch dependencies -RUN apt-get update && apt-get -y install \ - apt-transport-https \ - apt-utils \ - ca-certificates \ - git \ - libffi-dev \ - lsb-release \ - software-properties-common \ - python3-dev \ - python3-pip \ - python3-psycopg2 \ - && rm -rf /var/lib/apt/lists/* - -# Install Plaso -RUN add-apt-repository ppa:gift/stable -RUN apt-get update && apt-get -y install \ - plaso-tools \ - && rm -rf /var/lib/apt/lists/* - -# Use Python 3 pip (pip3) to install Timesketch -RUN pip3 install timesketch +FROM gcr.io/timesketch-build/release/timesketch:latest # Copy Timesketch config files into /etc/timesketch ADD . /tmp/timesketch