-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile_test
61 lines (51 loc) · 1.86 KB
/
Dockerfile_test
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# As of 2023-09-13, Ubuntu 22.04 is the latest LTS release but project ask for 18.04
FROM ubuntu:18.04
# This will stop openssh-server installer from opening a dialog,
# which would require human input
ENV DEBIAN_FRONTEND=noninteractive
# Update APT and upgrade currently installed software
# Install software as needed this includes the SSH to connect to the container
RUN apt-get update && apt-get upgrade -y \
curl \
sudo \
openssh-server\
git
# Install other software as needed
# Install Node.js 12.11.x LTS release
RUN curl -sL https://deb.nodesource.com/setup_12.x -o nodesource_setup.sh && \
sudo bash nodesource_setup.sh && \
sudo apt-get install -y nodejs && \
rm nodesource_setup.sh
# Install Jest, Babal, and ESLint globally
RUN npm install -g \
jest \
babel-jest \
@babel/core \
@babel/preset-env \
@babel/cli \
eslint
# Install VIM
RUN apt-get install -y vim
# Example:
# RUN apt-get install -y nodejs npm
# RUN npm install -g create-react-app
# RUN apt-get install -y python3 python3-pip
# RUN pip3 install flask
# Allow root to login via SSH
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# Allow password to login via SSH
RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
# Set SSH password to "root"
RUN echo 'root:root' | chpasswd
# Start the SSH service
RUN service ssh start
# Setup git config
RUN git config --global user.email [email protected]
RUN git config --global user.name Nomad-Rob
# Example of how to include your SSH key for GitHub:
# COPY host-machine-github-private-key /root/.ssh/github-private-key
# RUN chmod 600 /root/.ssh/github-private-key
# RUN echo 'eval `ssh-agent -s`' >> /root/.bashrc
# RUN echo 'ssh-add ~/.ssh/github' >> /root/.bashrc
# Run the SSH service on container startup
CMD ["/usr/sbin/sshd", "-D"]