Skip to content
Snippets Groups Projects
Commit 67d6f991 authored by George Sedov's avatar George Sedov
Browse files

docker fix once more

parent 4bb5aacc
No related branches found
No related tags found
No related merge requests found
......@@ -3,8 +3,3 @@ FROM gitlab.desy.de:5555/asapo/asapo/asapo-nomad-consul:latest
COPY scripts/ /var/asapo/
RUN cd /var/asapo && terraform init
RUN chmod -R og+wrX /var/log /var/lib /var/tmp /var/asapo /var/nomad /var/consul /etc/consul.d /etc/nomad.d
ENTRYPOINT ["supervisord", "--configuration", "/etc/supervisord.conf"]
FROM ubuntu:18.04
MAINTAINER DESY IT
RUN apt-get update && apt-get install -y supervisor apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common dnsutils
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
curl -fsSL https://packages.fluentbit.io/fluentbit.key | apt-key add -
RUN add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable" && \
add-apt-repository \
"deb [arch=amd64] https://packages.fluentbit.io/ubuntu/$(lsb_release -cs) \
$(lsb_release -cs) \
main"
RUN apt-get update && apt-get install -y docker-ce-cli wget unzip iproute2 vim td-agent-bit
ENV CONSUL_VERSION=1.10.3
ENV NOMAD_VERSION=1.1.6
ENV TERRAFORM_VERSION=1.0.8
ENV HASHICORP_RELEASES=https://releases.hashicorp.com
RUN set -eux && \
mkdir -p /tmp/build && \
cd /tmp/build && \
wget ${HASHICORP_RELEASES}/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip && \
unzip -d /bin consul_${CONSUL_VERSION}_linux_amd64.zip && \
wget ${HASHICORP_RELEASES}/nomad/${NOMAD_VERSION}/nomad_${NOMAD_VERSION}_linux_amd64.zip && \
unzip -d /bin nomad_${NOMAD_VERSION}_linux_amd64.zip && \
wget ${HASHICORP_RELEASES}/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
unzip -d /bin terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
cd /tmp && \
rm -rf /tmp/build && \
# tiny smoke test to ensure the binary we downloaded runs
consul version && \
nomad version && \
terraform version
FROM debian:bullseye
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg \
; \
rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | gpg --dearmor > /usr/share/keyrings/nomad-hashicorp-archive-keyring.gpg
RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/nomad-hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com bullseye main" >> /etc/apt/sources.list
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
supervisor \
gnupg-agent \
dnsutils \
nomad \
consul \
terraform \
iproute2 \
; \
rm -rf /var/lib/apt/lists/*
ADD supervisord.conf /etc/
RUN mkdir -p /var/log/supervisord/ /etc/consul.d /etc/nomad.d
RUN mkdir -p /var/log/supervisord/ /etc/consul.d /etc/nomad.d /var/nomad /var/consul
COPY scripts/ /var/run/asapo/
COPY scripts/ /var/asapo/
RUN cd /var/run/asapo && terraform init
RUN cd /var/asapo && terraform init
COPY jobs-* asapo-wait-service /usr/bin/
COPY *.py /etc/asapo/
COPY *.hcl.tpl /etc/asapo/
RUN chmod -R og+wrX /var /run /etc/consul.d /etc/nomad.d
RUN chmod -R og+wrX /var/log /var/lib /var/tmp /var/asapo /var/nomad /var/consul /etc/consul.d /etc/nomad.d
ENTRYPOINT ["supervisord", "--configuration", "/etc/supervisord.conf"]
......@@ -7,11 +7,11 @@ if [ ! -f /var/nomad/token ] && [ "${ACL_ENABLED}" = "true" ]; then
cat /var/nomad/token
fi
if [ -f /var/run/asapo/user_vars.tfvars ]; then
USER_VAR_FILE="-var-file=/var/run/asapo/user_vars.tfvars"
if [ -f /var/asapo/user_vars.tfvars ]; then
USER_VAR_FILE="-var-file=/var/asapo/user_vars.tfvars"
fi
cd /var/run/asapo && terraform apply -auto-approve $USER_VAR_FILE "$@"
cd /var/asapo && terraform apply -auto-approve $USER_VAR_FILE "$@"
if [ "${ACL_ENABLED}" = "true" ]; then
cat /var/nomad/token
......
......@@ -2,8 +2,8 @@
#export NOMAD_TOKEN=`cat /var/nomad/token `
if [ -f /var/run/asapo/user_vars.tfvars ]; then
USER_VAR_FILE="-var-file=/var/run/asapo/user_vars.tfvars"
if [ -f /var/asapo/user_vars.tfvars ]; then
USER_VAR_FILE="-var-file=/var/asapo/user_vars.tfvars"
fi
cd /var/run/asapo && terraform destroy -auto-approve $USER_VAR_FILE "$@"
cd /var/asapo && terraform destroy -auto-approve $USER_VAR_FILE "$@"
......@@ -8,13 +8,13 @@ childlogdir=/var/log/supervisord/ ; where child log files will liv
use=root
[program:prepare_scripts]
command=/usr/bin/python /etc/asapo/orchestr_config.py --input-files /etc/asapo/nomad.hcl.tpl /etc/asapo/consul.hcl.tpl --output-files /etc/nomad.d/nomad.hcl /etc/consul.d/consul.hcl
command=/usr/bin/python3 /etc/asapo/orchestr_config.py --input-files /etc/asapo/nomad.hcl.tpl /etc/asapo/consul.hcl.tpl --output-files /etc/nomad.d/nomad.hcl /etc/consul.d/consul.hcl
autorestart = false
startsecs = 1
priority=1
[program:consul]
command=/bin/consul agent -config-dir=/etc/consul.d
command=/usr/bin/consul agent -config-dir=/etc/consul.d
[program:nomad]
command=/bin/nomad agent -config=/etc/nomad.d
command=/usr/bin/nomad agent -config=/etc/nomad.d
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment