Skip to content
Permalink
Browse files

Adding autoexec support

  • Loading branch information...
Jim Van Fleet
Jim Van Fleet committed Sep 12, 2016
1 parent 20a0689 commit 63fab6a47a42fc28ae11522cc38502380570d8bc
Showing with 43 additions and 2 deletions.
  1. +10 −1 Dockerfile
  2. +5 −1 README.md
  3. +6 −0 container_files/bin/firstrun.sh
  4. +6 −0 container_files/bin/onbuild.sh
  5. +16 −0 tests/base.bats
@@ -25,13 +25,22 @@ RUN ln -sf /usr/share/zoneinfo/UTC /etc/localtime \
RUN yum -y install --setopt=tsflags=nodocs epel-release && \
yum -y install net-tools wget curl tar unzip mlocate logrotate strace telnet man unzip vim wget rsyslog cron && \
yum clean all && \
mkdir -p /opt/tier
mkdir -p \
/opt/autoexec/bin \
/opt/autoexec/onbuild \
/opt/autoexec/firstrun \
/opt/bin \
/opt/etc \
/opt/tier \

# Install Trusted Certificates
RUN update-ca-trust force-enable
ADD ./cert/InCommon.crt /etc/pki/ca-trust/source/anchors/
RUN update-ca-trust extract

ADD container_files/bin/firstrun.sh /opt/autoexec/bin/firstrun.sh
ADD container_files/bin/onbuild.sh /opt/autoexec/bin/onbuild.sh

# Set default environment variables.
ENV HOME /opt/tier

@@ -7,4 +7,8 @@ Internet2 managed CentOS 7 base image

## purpose

This container allows I2/TIER to insulate itself against upstream changes from CentOS managed images that may be unwanted. It can also be used to trigger global changes (e.g. a new InCommon.crt) when appropriate.
This container allows I2/TIER to insulate itself against upstream changes from CentOS managed images that may be unwanted. It can also be used to trigger global changes (e.g. a new InCommon.crt) when appropriate.

## autorun

You are encouraged to include /opt/autorun/bin/onbuild.sh when closing your Dockerfiles, and to include /opt/autorun/bin/firstrun.sh in your CMD entrypoints.
@@ -0,0 +1,6 @@
#!/bin/bash

for file in /opt/autoexec/firstrun/*
do
cmd "$file" >> /opt/etc/autoexec.firstrun.log
done
@@ -0,0 +1,6 @@
#!/bin/bash

for file in /opt/autoexec/build/*
do
cmd "$file" >> /opt/etc/autoexec.build.log
done
@@ -14,3 +14,19 @@ load ../common
[ "$status" -eq 0 ]
[[ ${output} == *"302"* || ${output} == *"200"* ]]
}

@test "Onbuild support script" {
docker run -i $maintainer/$imagename find /opt/autoexec/bin/onbuild.sh
}

@test "Onbuild support home" {
docker run -i $maintainer/$imagename find /opt/autoexec/onbuild
}

@test "Firstrun support bin" {
docker run -i $maintainer/$imagename find /opt/autoexec/bin/firstrun.sh
}

@test "Firstrun support home" {
docker run -i $maintainer/$imagename find /opt/autoexec/firstrun
}

0 comments on commit 63fab6a

Please sign in to comment.
You can’t perform that action at this time.