-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.arm
63 lines (53 loc) · 2.86 KB
/
Dockerfile.arm
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
FROM alpine:latest
#alpine:3.12.3 - 2020.12.31
LABEL maintainer="NexCloud Peter <peter@nexclipper.io>"
RUN apk add --no-cache --update git bash unzip curl openssh-server openssh-client openrc jq
#RUN apk add --no-cache --update gcc musl-dev make openssh-keygen
#RUN apk add --no-cache --update curl unzip openssh-server openrc jq bash
ENV TF_DEV=true
ENV TF_RELEASE=1
## WorkDIR & tmpDIR make
#RUN mkdir -p /data/tmp && mkdir -p ~/.terraform.d/plugins/
ENV WKDIR=/data
ENV PATH /usr/local/bin:$PATH
RUN mkdir -p $WKDIR/klevry /tmp/zzz ~/.terraform.d/plugins/ $WKDIR/terraform_state ~/.kube/
### latest version download ###
## Terraform Download ##
RUN curl -LO `curl -sL "https://www.terraform.io/downloads.html" | grep amd64 | grep linux | awk -F "\"" '{print $2}'` && \
unzip -o terraform*.zip && rm -rf terraform*.zip && \
chmod +x terraform && mv terraform /usr/bin/
## KubeCTL Download ##
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl && \
chmod +x kubectl && mv kubectl /usr/bin/
## Helm v3 Download ##
RUN curl -LO `curl -sL https://github.com/helm/helm/releases|egrep -v 'rc|beta|v2'|grep linux-amd64 |head -n1|awk -F"\"" '{print $2}'` && \
tar zxfp helm*.tar.gz && \
chmod +x linux-amd64/helm && mv linux-amd64/helm /usr/bin/ && \
rm -rf helm*.tar.gz linux-amd64
## tobs Download ##
#RUN curl -LO https://github.com/`curl -sL https://github.com/timescale/tobs/releases | egrep -v 'rc|beta|v2'| grep Linux | grep x86 | head -n1 | awk -F"\"" '{print $2}'` && \
RUN curl -LO https://github.com/timescale/tobs/releases/download/0.3.0/tobs_0.3.0_Linux_x86_64 && \
chmod +x tobs* && mv tobs* /usr/bin/tobs
COPY .ssh /root/.ssh
COPY entrypoint.sh /entrypoint.sh
COPY ./scripts/provider.sh /usr/bin/tfprovider
COPY ./scripts/beecmd /usr/bin/beecmd
COPY ./scripts/busybee.sh /usr/bin/busybee
#COPY ./scripts/get_pubkey.sh /usr/local/bin/get_pubkey.sh
# ssh setting
RUN echo "root:dkdhajfldkvmek!" | chpasswd
RUN mv /etc/ssh/sshd_config /etc/ssh/sshd_config.ori; \
#sed -e "s|[#]*AuthorizedKeysCommand none|AuthorizedKeysCommand /usr/local/bin/get_pubkey.sh|g" \
# -e "s|[#]*AuthorizedKeysCommandUser nobody|AuthorizedKeysCommandUser nobody|g" \
sed -e "s|[#]*PermitRootLogin prohibit-password|PermitRootLogin yes|g" \
-e "s|[#]*UsePAM yes|UsePAM no|g" \
-e "s|[#]*PermitUserEnvironment no|PermitUserEnvironment no|g" \
-e "s|[#]*PubkeyAuthentication yes|PubkeyAuthentication yes|g" \
/etc/ssh/sshd_config.ori > /etc/ssh/sshd_config;
RUN sed -i 's/cgroup_add_service$/echo "NexClipper" #cgroup_add_service#/g' /lib/rc/sh/openrc-run.sh
RUN rc-update add sshd; mkdir /run/openrc && touch /run/openrc/softlevel; rc-status
WORKDIR $WKDIR
#ENTRYPOINT ["/entrypoint.sh"]
#CMD ["/bin/sh"]
CMD ["/bin/bash", "/entrypoint.sh"]
#ENTRYPOINT ["terraform"]