1
0
Fork 0
This repository has been archived on 2024-01-05. You can view files and clone it, but cannot push or open issues or pull requests.
command_gateway/Dockerfile

31 lines
795 B
Text
Raw Normal View History

2023-01-31 14:36:59 +01:00
FROM ubuntu:latest
# Configure requirements
RUN apt update && apt install openssh-server curl build-essential protobuf-compiler -y
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
2023-01-31 19:38:48 +01:00
RUN useradd -rm -d /home/test -s /opt/gateway/target/release/gtwy_interpreter test
2023-01-31 14:36:59 +01:00
RUN echo 'test:test' | chpasswd
# Build project binaries
COPY . /opt/gateway
WORKDIR /opt/gateway
2023-01-31 19:38:48 +01:00
RUN cargo build --release --bin gtwyd
RUN cargo build --release --bin gtwy_interpreter
2023-01-31 14:36:59 +01:00
RUN mkdir -p /var/run
RUN chmod ugo+rx /var
RUN chmod ugo+rwx /var/run
RUN echo '#!/bin/sh\n\
/usr/sbin/sshd -D&\n\
2023-01-31 19:38:48 +01:00
su - test -s /bin/sh -c "/opt/gateway/target/release/gtwyd"' > /opt/startup.sh
2023-01-31 14:36:59 +01:00
RUN chmod +x /opt/startup.sh
RUN service ssh start
EXPOSE 22
CMD /opt/startup.sh