Skip to content

Instantly share code, notes, and snippets.

View nehabhardwaj01's full-sized avatar
🏠
Working from home

Neha Bhardwaj nehabhardwaj01

🏠
Working from home
View GitHub Profile
#!/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
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
#!/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
#!/bin/bash
timestamp=`date +%Y/%m/%d-%H:%M:%S`
echo "System path is $PATH at $timestamp"
// Create a directory.
mkdir static_content
// Copy all the files to this directory.
cp hello.html static_content/
cp hello.tar.gz static_content/
<?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>
#!/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
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/*
#!/bin/bash
timestamp=`date +%Y/%m/%d-%H:%M:%S`
echo "System path is $PATH at $timestamp"