diff --git a/utils/build/docker/python/django-poc.Dockerfile b/utils/build/docker/python/django-poc.Dockerfile index 621cb688cbb..2f866225235 100644 --- a/utils/build/docker/python/django-poc.Dockerfile +++ b/utils/build/docker/python/django-poc.Dockerfile @@ -1,26 +1,9 @@ -FROM python:3.9 - -# print versions -RUN python --version && curl --version - -# install hello world app -RUN pip install django pycryptodome gunicorn gevent requests - -RUN mkdir app -RUN django-admin startproject django_app app -WORKDIR /app -RUN python3 manage.py startapp app - -RUN sed -i "1s/^/from django.urls import include\n/" django_app/urls.py -RUN sed -i "s/admin\///g" django_app/urls.py -RUN sed -i "s/admin.site.urls/include(\"app.urls\")/g" django_app/urls.py -RUN sed -i "s/ALLOWED_HOSTS\s=\s\[\]/ALLOWED_HOSTS = \[\"0.0.0.0\",\"weblog\"\,\"localhost\"\]/g" django_app/settings.py +FROM datadog/system-tests:django-poc.base-v0 COPY utils/build/docker/python/django/app.sh /app/app.sh COPY utils/build/docker/python/django/django.app.urls.py /app/app/urls.py COPY utils/build/docker/python/iast.py /app/iast.py - COPY utils/build/docker/python/install_ddtrace.sh utils/build/docker/python/get_appsec_rules_version.py binaries* /binaries/ RUN /binaries/install_ddtrace.sh diff --git a/utils/build/docker/python/django-poc.base.Dockerfile b/utils/build/docker/python/django-poc.base.Dockerfile new file mode 100644 index 00000000000..d195eaad036 --- /dev/null +++ b/utils/build/docker/python/django-poc.base.Dockerfile @@ -0,0 +1,25 @@ +FROM python:3.9-slim + +# install bin dependancies +RUN apt-get update && apt-get install -y curl git gcc g++ + +# print versions +RUN python --version && curl --version + +# install python deps +RUN pip install django pycryptodome gunicorn gevent requests + +RUN mkdir app +RUN django-admin startproject django_app app +WORKDIR /app +RUN python3 manage.py startapp app + +RUN sed -i "1s/^/from django.urls import include\n/" django_app/urls.py +RUN sed -i "s/admin\///g" django_app/urls.py +RUN sed -i "s/admin.site.urls/include(\"app.urls\")/g" django_app/urls.py +RUN sed -i "s/ALLOWED_HOSTS\s=\s\[\]/ALLOWED_HOSTS = \[\"0.0.0.0\",\"weblog\"\,\"localhost\"\]/g" django_app/settings.py + + +# docker build --progress=plain -f utils/build/docker/python/django-poc.base.Dockerfile -t datadog/system-tests:django-poc.base-v0 . +# docker push datadog/system-tests:django-poc.base-v0 + diff --git a/utils/build/docker/python/flask-poc.Dockerfile b/utils/build/docker/python/flask-poc.Dockerfile index 14c188e40df..6c61a2c39a2 100644 --- a/utils/build/docker/python/flask-poc.Dockerfile +++ b/utils/build/docker/python/flask-poc.Dockerfile @@ -1,11 +1,4 @@ -FROM python:3.9 - -# print versions -RUN python --version && curl --version - -# install hello world app -# Tracer does not support flask 2.3.0 or higher, pin the flask version for now -RUN pip install flask==2.2.4 gunicorn gevent requests pycryptodome psycopg2 +FROM datadog/system-tests:flask-poc.base-v0 COPY utils/build/docker/python/flask /app COPY utils/build/docker/python/iast.py /app/iast.py @@ -23,6 +16,5 @@ ENV DD_REMOTECONFIG_POLL_SECONDS=1 ENV FLASK_APP=app.py CMD ./app.sh -# docker build -f utils/build/docker/python.flask-poc.Dockerfile -t test . +# docker build -f utils/build/docker/python/flask-poc.Dockerfile -t test . # docker run -ti -p 7777:7777 test - diff --git a/utils/build/docker/python/flask-poc.base.Dockerfile b/utils/build/docker/python/flask-poc.base.Dockerfile new file mode 100644 index 00000000000..6fb787a086a --- /dev/null +++ b/utils/build/docker/python/flask-poc.base.Dockerfile @@ -0,0 +1,15 @@ +FROM python:3.9-slim + +# install bin dependancies +RUN apt-get update && apt-get install -y curl git gcc g++ + +# print versions +RUN python --version && curl --version + +# install python deps +# Tracer does not support flask 2.3.0 or higher, pin the flask version for now +RUN pip install flask==2.2.4 gunicorn gevent requests pycryptodome psycopg2-binary + +# docker build --progress=plain -f utils/build/docker/python/flask-poc.base.Dockerfile -t datadog/system-tests:flask-poc.base-v0 . +# docker push datadog/system-tests:flask-poc.base-v0 + diff --git a/utils/build/docker/python/uds-flask.Dockerfile b/utils/build/docker/python/uds-flask.Dockerfile index 2a1acffb4bb..a392cda16f8 100644 --- a/utils/build/docker/python/uds-flask.Dockerfile +++ b/utils/build/docker/python/uds-flask.Dockerfile @@ -1,11 +1,4 @@ -FROM python:3.9 - -# print versions -RUN python --version && curl --version - -# install hello world app -# Tracer does not support flask 2.3.0 or higher, pin the flask version for now -RUN pip install flask==2.2.4 gunicorn gevent requests pycryptodome psycopg2 +FROM datadog/system-tests:flask-poc.base-v0 COPY utils/build/docker/python/flask /app COPY utils/build/docker/python/iast.py /app/iast.py diff --git a/utils/build/docker/python/uwsgi-poc.Dockerfile b/utils/build/docker/python/uwsgi-poc.Dockerfile index c2146bc1f3a..c0676dae295 100644 --- a/utils/build/docker/python/uwsgi-poc.Dockerfile +++ b/utils/build/docker/python/uwsgi-poc.Dockerfile @@ -1,11 +1,4 @@ -FROM python:3.9 - -# print versions -RUN python --version && curl --version - -# install hello world app -# Tracer does not support flask 2.3.0 or higher, pin the flask version for now -RUN pip install flask==2.2.4 uwsgi requests pycryptodome psycopg2 +FROM datadog/system-tests:flask-poc.base-v0 COPY utils/build/docker/python/flask /app COPY utils/build/docker/python/iast.py /app/iast.py