This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Start the run once job. | |
echo "Docker container has been started" | |
declare -p | grep -Ev 'BASHOPTS|BASH_VERSINFO|EUID|PPID|SHELLOPTS|UID' > /container.env | |
# Setup a cron schedule | |
echo "SHELL=/bin/bash | |
BASH_ENV=/container.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:16.04 | |
MAINTAINER Neha Bhardwaj | |
# Install cron | |
RUN apt-get update && apt-get install -y cron | |
# Add files | |
ADD run.sh /run.sh | |
ADD entrypoint.sh /entrypoint.sh | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Start the run once job. | |
echo "Docker container has been started" | |
# Setup a cron schedule | |
echo "* * * * * /run.sh >> /var/log/cron.log 2>&1 | |
# This extra line makes it a valid cron" > scheduler.txt | |
crontab scheduler.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
timestamp=`date +%Y/%m/%d-%H:%M:%S` | |
echo "System path is $PATH at $timestamp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a directory. | |
mkdir static_content | |
// Copy all the files to this directory. | |
cp hello.html static_content/ | |
cp hello.tar.gz static_content/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"> | |
<Configure class="org.eclipse.jetty.server.handler.ContextHandler"> | |
<Set name="contextPath">/</Set> | |
<Set name="handler"> | |
<New class="org.eclipse.jetty.server.handler.ResourceHandler"> | |
<Set name="resourceBase">/jetty/static_content</Set> | |
<Set name="directoriesListed">true</Set> | |
</New> | |
</Set> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cp expose_static_content.xml /jetty/webapps/ | |
# Optionally, copy or move the static content directory inside jetty to prevent any data loss | |
mv /static_content /jetty/static_content/ | |
/jetty/bin/jetty.sh run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:latest | |
MAINTAINER NEHA BHARDWAJ | |
ENV JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk/jre \ | |
PATH=$PATH:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin \ | |
JAVA_VERSION=8u191 | |
EXPOSE 8080 | |
RUN apk add --update bash wget tar openjdk8-jre && rm -rf /var/cache/apk/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
timestamp=`date +%Y/%m/%d-%H:%M:%S` | |
echo "System path is $PATH at $timestamp" |