Ver Fonte

Create an entrypoint

gabriel há 6 anos atrás
pai
commit
e636f5d46a
2 ficheiros alterados com 14 adições e 2 exclusões
  1. 4 2
      1.4.0/kea-ik/Dockerfile
  2. 10 0
      1.4.0/kea-ik/execute.sh

+ 4 - 2
1.4.0/kea-ik/Dockerfile

@@ -3,11 +3,13 @@ FROM docker.infra.flowdat.com/fd3/kea-oss-1.4.0:latest
 COPY keys/ /opt/keys
 COPY inotify.sh /usr/local/etc/kea/inotify.sh
 COPY script.sh /opt/script.sh
+COPY execute.sh /opt/execute.sh
 COPY hooks /opt/hooks
 COPY supervisord /etc/supervisord
 
 # C++ LIBRARIES
-RUN git clone git://github.com/alanxz/rabbitmq-c.git; \
+RUN chmod +x /opt/execute.sh; \
+    git clone git://github.com/alanxz/rabbitmq-c.git; \
     cd rabbitmq-c; \
     mkdir build; \
     cd build; \
@@ -44,6 +46,6 @@ RUN git clone git://github.com/alanxz/rabbitmq-c.git; \
     chmod +x /opt/script.sh; \
     rm -rf /var/lib/apt/lists/*
 
-CMD /opt/script.sh
+ENTRYPOINT ["/opt/execute.sh"]
 
 HEALTHCHECK --interval=5s --timeout=3s CMD pgrep kea-dhcp4

+ 10 - 0
1.4.0/kea-ik/execute.sh

@@ -0,0 +1,10 @@
+#!/bin/bash
+
+if [ "$1" == "copy" ];
+then
+    echo "Argument $1"
+	sleep 360
+    echo "SALIO"
+else
+    sh /opt/script.sh
+fi