-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99c4315
commit 31f4220
Showing
5 changed files
with
119 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM python:3.6-stretch | ||
|
||
RUN mkdir -p /workdir | ||
RUN mkdir -p /opt/tuxeatpi_common | ||
|
||
COPY misc/docker/common/entrypoint.sh /entrypoint.sh | ||
|
||
COPY requirements.txt /opt/tuxeatpi_common/requirements.txt | ||
COPY test_requirements.txt /opt/tuxeatpi_common/test_requirements.txt | ||
|
||
RUN python --version | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends git gcc && \ | ||
apt-get clean && \ | ||
pip install -r /opt/tuxeatpi_common/requirements.txt && \ | ||
apt-get -y purge gcc git && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
COPY setup.py /opt/tuxeatpi_common/ | ||
COPY tuxeatpi_common /opt/tuxeatpi_common/tuxeatpi_common | ||
|
||
RUN cd /opt/tuxeatpi_common && \ | ||
python setup.py install && \ | ||
rm -rf /opt/tuxeatpi_common | ||
|
||
WORKDIR /workdir | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
set -x | ||
|
||
# Get tep args | ||
ARGS=$@ | ||
# Get tep executable | ||
EXE=$(which tep-$1) | ||
|
||
set -e | ||
|
||
if [ "$EXE" != "" ]; then | ||
USER_UID=${USER_UID:-1000} | ||
USER_GID=${USER_GID:-1000} | ||
|
||
# create user group | ||
if ! getent group tep >/dev/null; then | ||
groupadd -f -g ${USER_GID} tep | ||
fi | ||
|
||
# create user with uid and gid matching that of the host user | ||
if ! getent passwd tep >/dev/null; then | ||
adduser --uid ${USER_UID} --gid ${USER_GID} \ | ||
--disabled-login \ | ||
--gecos 'TuxEatPi' tep | ||
|
||
fi | ||
if [ $# == "1" ]; | ||
then | ||
exec su tep -c "$EXE -w /workdir -I /intents -D /dialogs" | ||
else | ||
exec su tep -c "$EXE -w /workdir -I /intents -D /dialogs $@" | ||
# OR exec su tep -c "$EXE $ARGS" ???? | ||
fi | ||
|
||
else | ||
echo "tep-$1 executable not found. Running $1" | ||
exec "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM tuxeatpi/common | ||
|
||
|
||
ENV PULSE_SERVER /run/pulse/native | ||
|
||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends pulseaudio-utils pulseaudio && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/ | ||
|
||
RUN echo enable-shm=no >> /etc/pulse/client.conf | ||
|
||
VOLUME /run/pulse |