-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
71 lines (52 loc) · 2.61 KB
/
Dockerfile
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
62
63
64
65
66
67
68
69
70
FROM centos:7.8.2003
ENV GO111MODULE on
#ENV GOPROXY=http://192.168.82.28:3000
ENV TF_LOG DEBUG
ENV TF_LOG_PATH /tmp/tf_caep.log
#RUN apk add bash git wget util-linux pkgconfig libvirt-dev build-base qemu-img qemu-system-x86_64 bash curl
RUN yum install -y make gcc vim git wget unzip
WORKDIR /root/terraform-provider-caep
RUN wget -q https://releases.hashicorp.com/terraform/1.0.5/terraform_1.0.5_linux_amd64.zip && \
unzip ./terraform_1.0.5_linux_amd64.zip -d /usr/local/bin && rm -f terraform_1.0.5_linux_amd64.zip
RUN wget -q https://dl.google.com/go/go1.17.2.linux-amd64.tar.gz && \
tar xzf ./go1.17.2.linux-amd64.tar.gz -C /usr/local && \
printf "export PATH=\$PATH:/usr/local/go/bin\n" >> /root/.bashrc && \
rm -f go1.17.2.linux-amd64.tar.gz
COPY ./ ./
RUN source /root/.bashrc && \
cd /root/terraform-provider-caep && \
make install
RUN yum -y install openssh-server openssh-clients initscripts
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
RUN ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
RUN ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ''
RUN ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ''
#RUN sed -i "s/#UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config
#RUN sed -i "s/UsePAM.*/UsePAM no/g" /etc/ssh/sshd_config
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN useradd -ms /bin/bash caeper && \
mkdir -p /home/caeper/.ssh && \
ssh-keygen -t ecdsa -N '' -f /home/caeper/.ssh/caeper_id_ecdsa && \
cp /home/caeper/.ssh/caeper_id_ecdsa.pub /home/caeper/.ssh/authorized_keys && \
chown caeper.caeper -R /home/caeper && \
chmod 0400 /home/caeper/.ssh/caeper_id_ecdsa
RUN echo 'caeper:pass123' | chpasswd
RUN cp -aR /root/.terraform.d /home/caeper
COPY ./examples /home/caeper
COPY ./caeper.vimrc /home/caeper/.vimrc
RUN mkdir -p /home/caeper/.vim/autoload /home/caeper/.vim/bundle && \
curl -LSso /home/caeper/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
RUN git clone https://github.com/hashivim/vim-terraform.git /home/caeper/.vim/bundle/vim-terraform \
&& chown caeper.caeper -R /home/caeper
EXPOSE 22
EXPOSE 10287
#RUN yum install -y git unzip nmap wget python3 pip3
#RUN pip3 install --user pytest
#ADD ./pytester.tgz /
#RUN mv ./pytester /
#RUN pip3 install --user -r /pytester/pytest.req.txt
#RUN chmod +x /root/terraform-provider-caep/entrypoint.sh
#CMD ["/tf_caep_provider_bin","--listen-port=12345","--log-level=debug"]
#CMD ["/usr/sbin/init"]
#CMD ["/usr/sbin/sshd","-D"]
CMD ["bash","-c","/root/terraform-provider-caep/entrypoint.sh"]