-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile
32 lines (24 loc) · 872 Bytes
/
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
FROM ubuntu:18.04
ARG ssh_prv_key
ARG ssh_pub_key
ARG branch
# Make sure we have bash as our default shell
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# Get the packages needed for Ubuntu
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -y update && \
apt-get install -y \
openssh-server \
git
# Authorize SSH Host
RUN mkdir -p /root/.ssh && \
chmod 0700 /root/.ssh && \
ssh-keyscan 190.171.41.51 > /root/.ssh/known_hosts
# Add the keys and set permissions
RUN echo "$ssh_prv_key" > /root/.ssh/id_rsa && \
chmod 600 /root/.ssh/id_rsa
RUN git clone --branch "$branch" https://github.com/edenia/antelope-tools.git /opt/eosio-dashboard
WORKDIR /opt/eosio-dashboard
CMD eval `ssh-agent` && ssh-add \
&& export GIT_SSH_COMMAND="/usr/bin/ssh -i /root/.ssh/id_rsa" \
&& git push "ssh://${USER}@190.171.41.51/var/repo/eosio-dashboard.git" HEAD:"$branch"