Closed guilhemmarchand closed 4 years ago
Update on this issue:
I could finally successfully generate a Docker image doing the following:
python setup.py sdist
docker build --pull --rm -f "dockerfiles/Dockerfile" -t eventgen:710 .
Notes: Having these intruction would be helpful for others.
Finally I could achieve my goal and running successfully the EventGen as a PyPI within Docker, which is super awesome.
I pushed to: https://hub.docker.com/repository/docker/guilhemmarchand/splunk-eventgen
With some quick instructions using docker-compose.
Note I tried to get the last alpine version working but the compilation will fail:
Compile failed: command 'gcc' failed with exit status 1
creating tmp
cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInithcfcdu93.c -o tmp/xmlXPathInithcfcdu93.o
cc tmp/xmlXPathInithcfcdu93.o -L/lib -lxml2 -o a.out
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4zmufbxl/lxml/setup.py'"'"'; __file__='"'"'/tmp/pip-install-4zmufbxl/lxml/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-lat_iuku/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.8/lxml Check the logs for full command output.
Tried the following Dockerfile:
FROM redis:6.0.5-alpine
RUN apk --no-cache upgrade && \
apk add --no-cache --update \
python3 \
python3-dev \
python2-dev \
py3-pip \
gcc \
libc-dev \
libffi-dev \
openssl-dev \
libxml2-dev \
libxslt-dev \
bash \
sudo \
openssh \
tar \
acl \
g++ \
git \
curl && \
pip3 install --upgrade pip && \
rm -rf /tmp/* && \
rm -rf /var/cache/apk/* && \
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa && \
mkdir -p /var/run/sshd && \
mkdir -p /root/.ssh && \
chmod 0700 /root/.ssh && \
passwd -u root && \
# install dependencies of conductor2 used by perf
pip3 install filelock twisted requests queuelib psutil crochet msgpack-python unidecode attrdict service_identity && \
pip3 install git+https://github.com/esnme/ultrajson.git@v1.35
COPY dockerfiles/sshd_config /etc/ssh/sshd_config
COPY dockerfiles/entrypoint.sh /sbin/entrypoint.sh
COPY dist/splunk_eventgen*.tar.gz /root/splunk_eventgen.tgz
RUN pip3 install /root/splunk_eventgen.tgz && \
rm /root/splunk_eventgen.tgz
COPY pyproject.toml /usr/lib/python3.7/site-packages/splunk_eventgen/pyproject.toml
COPY poetry.lock /usr/lib/python3.7/site-packages/splunk_eventgen/poetry.lock
EXPOSE 2222 6379 9500
RUN chmod a+x /sbin/entrypoint.sh
WORKDIR /usr/lib/python3.7/site-packages/splunk_eventgen
ENTRYPOINT ["/sbin/entrypoint.sh"]
Replacing py2-pip by pi3-pip and pip2 by pip3 (as it is not available anymore) but won't work.
As you mentioned, the fix is in the develop branch and will be available in the next release, so closing this issue out. We are planning to get a new release out by the end of day today. If you still see the issue, feel free to re-open. We also don't have any plans to upgrade the alpine image, as we have dependencies on the python2 ujson package.
@jmeixensperger thank you very much, perfectly fine 👍
Describe the bug
With the goal of using Eventgen in a PyPI engine to leverage more capabilities, I am facing failures to build a Docker container, and even building EvenGen out of Docker.
In addition, while the repo provides a Dockerfile, there are 0 instructions at all reagrding Docker, and not even a mention of the Docker option in the docs, what about publishing a release in Docker Hub ? This would be really awesome and time saving ;-)
To Reproduce Steps to reproduce the behavior:
Expected behavior
Actual behavior
Once the the package is built successfully with:
python setup.py sdist
Running Docker build (instructions would be nice)
docker build . -f dockerfiles/Dockerfile -t splunk-eventgen:701
Results:
I have tried different things, like using a more recent version of the redis alpine: (note: py2-pip does not exist anymore, py3-pip is required and pip2 changed to pip3)
But complilation fails:
I assume the current version of the setup.py would need some update to work with latest version of Python3 and pip ? But the develop branch does not contain anything at all.
Thank you in advance