-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.training
36 lines (27 loc) · 1.34 KB
/
Dockerfile.training
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
ARG base_tag=latest
FROM ghcr.io/testillano/h2agent:${base_tag}
MAINTAINER testillano
LABEL testillano.h2agent.description="Docker image for h2agent service for training"
COPY tools /home/h2agent/tools
COPY demo /home/h2agent/demo
COPY kata /home/h2agent/kata
WORKDIR /home/h2agent/
ARG base_os=ubuntu
ARG enable_qa=false
# Update packages
RUN if [ "${base_os}" = "alpine" ] ; then apk update ; elif [ "${base_os}" = "ubuntu" ] ; then apt-get update ; fi
# Installation
RUN if [ "${base_os}" = "alpine" ] ; then apk add dos2unix ; elif [ "${base_os}" = "ubuntu" ] ; then apt-get install -y dos2unix netcat-openbsd ; fi
## Installation for questions & answers (langchain & OpenAI)
RUN if [ "${enable_qa}" = "true" -a "${base_os}" = "ubuntu" ] ; then apt-get install -y python3 python3-pip python3.12-venv ; fi
RUN if [ "${enable_qa}" = "true" -a "${base_os}" = "ubuntu" ] ; then python3 -m venv /opt/venv ; /bin/bash -c "source /opt/venv/bin/activate && pip3 install -r tools/questions-and-answers/requirements.txt" ; fi
# Cleanup
RUN if [ "${base_os}" = "alpine" ] ; then rm -rf /var/cache/apk/* ; elif [ "${base_os}" = "ubuntu" ] ; then apt-get clean ; fi
RUN ln -s /opt/h2agent
RUN ln -s /opt/h2client
RUN ln -s /opt/matching-helper
RUN ln -s /opt/arashpartow-helper
RUN ln -s /opt/udp-server
RUN ln -s /opt/udp-client
ENTRYPOINT ["sleep", "infinity"]
CMD []