Dockerfile 1.86 KB
Newer Older
1
2
# FROM debian:stretch
FROM alpine
Valentino Lauciani's avatar
Valentino Lauciani committed
3

4
LABEL maintainer="Matteo Quintiliani <matteo.quintiliani@ingv.it>"
Valentino Lauciani's avatar
Valentino Lauciani committed
5
6
7
8
9

ENV DEBIAN_FRONTEND=noninteractive
ENV INITRD No
ENV FAKE_CHROOT 1
ENV SWARM_BASEURL=https://volcanoes.usgs.gov/software/swarm/bin/
Valentino Lauciani's avatar
Valentino Lauciani committed
10
ENV SWARM_VERSION=swarm-3.0.0
Valentino Lauciani's avatar
Valentino Lauciani committed
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
# Install Swarm
WORKDIR /opt
RUN wget "${SWARM_BASEURL}/${SWARM_VERSION}-bin.zip" \
    && chmod +x /opt/${SWARM_VERSION}-bin.zip \
    && unzip ${SWARM_VERSION}-bin.zip 

# RUN apt-get update \
		# && apt-get dist-upgrade -y --no-install-recommends \
		# && apt-get install -y \
		# build-essential \
		# vim \
		# git \
		# telnet \
		# dnsutils \
		# wget \
		# default-jre \
		# unzip

RUN apk add --no-cache \
		procps \
		sudo \
		bash \
		openssh-client \
		git \
		ttf-dejavu \
		openjdk8-jre
Valentino Lauciani's avatar
Valentino Lauciani committed
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

# Set .bashrc
RUN echo "" >> /root/.bashrc \
     && echo "alias ll='ls -l --color'" >> /root/.bashrc \
     && . /root/.bashrc

# Copy GIT deploy key
RUN mkdir /root/.ssh
COPY id_rsa* known_hosts /root/.ssh/
RUN chmod 600 /root/.ssh/id_rsa \
    && chmod 644 /root/.ssh/id_rsa.pub \
    && chmod 644 /root/.ssh/known_hosts \
    && chmod 700 /root/.ssh/

# Clone 'earthworm/swarm' git repository
53
ARG CACHEGIT=1
54
RUN git clone https://docker_swarm:Gq5GpgGpmxRsiVvT6bxJ@gitlab.rm.ingv.it/earthworm/swarm.git
55
ARG CACHEGIT=0
Valentino Lauciani's avatar
Valentino Lauciani committed
56
57
58
59
60
61
62
63
64
65
66

# Copy INGV swarm configuration files from git
RUN cp -v /opt/swarm/Swarm* /opt/${SWARM_VERSION}/ \
    && cp -v /opt/swarm/swarm* /opt/${SWARM_VERSION}/ \
    && cp -v /opt/swarm/layouts/* /opt/${SWARM_VERSION}/layouts/ \
    && cp -v -R /opt/swarm/mapdata/PNG /opt/${SWARM_VERSION}/mapdata/ \
    && cp -v -R /opt/swarm/mapdata/italy /opt/${SWARM_VERSION}/mapdata/ \
    && cp -v -R /opt/swarm/mapdata/mormanno /opt/${SWARM_VERSION}/mapdata/ 

# Run Swarm
WORKDIR /opt/${SWARM_VERSION}
67
RUN sed -i'.bak' -e "s/windowMaximized=.*$/windowMaximized=false/g" Swarm.config
Valentino Lauciani's avatar
Valentino Lauciani committed
68
69
RUN chmod +x swarm.sh
ENTRYPOINT ["./swarm.sh"]