Skip to content

Commit

Permalink
initial project
Browse files Browse the repository at this point in the history
  • Loading branch information
mardafirmansyah committed Jan 18, 2019
1 parent 5989fc0 commit f472196
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM phusion/baseimage:latest
LABEL maintainer="marda.firmansyah@zenofa.com"

# Tell the container there is no tty
ENV DEBIAN_FRONTEND noninteractive

ENV DEFAULT_CONTAINER_TIMEZONE Asia/Jakarta

# Automatic choose local mirror for sources list
COPY sources.list /etc/apt/sources.list

# Update to latest packages and tidy up
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get install -y apt-utils tzdata iputils-ping \
&& apt-get -y autoremove \
&& apt-get -y clean \
&& rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/*

COPY . /app

RUN chmod +x /app/bin/*

RUN ln -s /app/bin/set_timezone.sh /etc/my_init.d/00_set_timezone.sh
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# ubuntu-docker
# ubuntu-docker
30 changes: 30 additions & 0 deletions bin/colours.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

RED='\033[0;31m'
GREEN='\033[0;32m'
CYAN='\033[0;36m'
YELLOW='\033[1;33m'
LIGHTCYAN='\033[1;36m'
NC='\033[0m'

_title() {
printf "${CYAN}*** ${LIGHTCYAN}$@${NC}\n"
}

_good() {
printf "${GREEN} * ${NC}$@\n"
}

_error() {
printf " ${RED}* [ERROR]${NC} $@\n\n"
exit 1;
}

_warning() {
printf " ${YELLOW}* [WARNING]${NC} $@\n"
}

export -f _title
export -f _good
export -f _error
export -f _warning
5 changes: 5 additions & 0 deletions bin/set_timezone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

echo ${CONTAINER_TIMEZONE:-$DEFAULT_CONTAINER_TIMEZONE} > /etc/timezone
ln -fs /usr/share/zoneinfo/${CONTAINER_TIMEZONE:-$DEFAULT_CONTAINER_TIMEZONE} /etc/localtime
dpkg-reconfigure tzdata
9 changes: 9 additions & 0 deletions sources.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
deb http://mirror.rackspace.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirror.rackspace.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirror.rackspace.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirror.rackspace.com/ubuntu/ bionic-security main restricted universe multiverse

deb-src http://mirror.rackspace.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirror.rackspace.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirror.rackspace.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirror.rackspace.com/ubuntu/ bionic-security main restricted universe multiverse

0 comments on commit f472196

Please sign in to comment.