Skip to content

Commit 00e31a0

Browse files
committed
Added JDK 1.7 to DEVBOX
1 parent ad9cd0f commit 00e31a0

File tree

6 files changed

+113
-0
lines changed

6 files changed

+113
-0
lines changed

devbox/Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM ubuntu:14.04
2+
MAINTAINER Jean-Marc MEESSEN <[email protected]>
3+
4+
# Pull base image.
5+
6+
7+
# Install.
8+
RUN \
9+
sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \
10+
apt-get update && \
11+
apt-get -y upgrade && \
12+
apt-get install -y build-essential && \
13+
apt-get install -y software-properties-common && \
14+
apt-get install -y byobu curl git htop man unzip vim wget && \
15+
rm -rf /var/lib/apt/lists/*
16+
17+
# Install Java.
18+
RUN \
19+
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
20+
add-apt-repository -y ppa:webupd8team/java && \
21+
apt-get update && \
22+
apt-get install -y oracle-java7-installer && \
23+
rm -rf /var/lib/apt/lists/* && \
24+
rm -rf /var/cache/oracle-jdk7-installer
25+
26+
# Define working directory.
27+
WORKDIR /data
28+
29+
# Define commonly used JAVA_HOME variable
30+
ENV JAVA_HOME /usr/lib/jvm/java-7-oracle

devbox/Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.PHONY: build shell
2+
3+
DOCKER_IMAGE := cpt_igloo/devbox
4+
5+
build:
6+
docker build --rm --tag "$(DOCKER_IMAGE)" .
7+
docker run --rm -v $(CURDIR)/bats-tests:/tmp cpt_igloo/bats /usr/local/bin/bats /tmp/test.bats
8+
9+
shell:
10+
docker run --rm --tty --interactive "$(DOCKER_IMAGE)" /bin/bash -l
11+
12+
validate:
13+
docker run -v $(CURDIR)/bats-tests:/tmp cpt_igloo/bats /usr/local/bin/bats /tmp/test.bats $(DOCKER_IMAGE)
14+

devbox/bats-tests/test.bats

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bats
2+
3+
@test "Check JDK presence" {
4+
run docker run -rm cpt_igloo/devbox:latest java -version
5+
#[ "${lines[1]}" = "Java(TM) SE Runtime Environment (build 1.7.0_76-b13)" ]
6+
[ $? -eq 0 ]
7+
}
8+
9+
@test "Check maven presence" {
10+
run docker run -rm cpt_igloo/devbox:latest app/fuse/maven/bin/mvn -version
11+
#[ "${lines[1]}" = "Java(TM) SE Runtime Environment (build 1.7.0_76-b13)" ]
12+
[ $? -eq 0 ]
13+
}

docker-bats/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM ubuntu:trusty
2+
MAINTAINER Thomas LEVEIL <[email protected]>
3+
4+
## setup APT
5+
RUN sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty main restricted universe multiverse' /etc/apt/sources.list
6+
RUN sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty-updates main restricted universe multiverse' /etc/apt/sources.list
7+
RUN sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty-backports main restricted universe multiverse' /etc/apt/sources.list
8+
RUN sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty-security main restricted universe multiverse' /etc/apt/sources.list
9+
RUN apt-get update
10+
ENV DEBIAN_FRONTEND noninteractive
11+
12+
## install dependencies
13+
RUN apt-get install -y git
14+
15+
## install Bats
16+
RUN git clone https://github.com/sstephenson/bats.git
17+
RUN bats/install.sh /usr/local
18+

docker-bats/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.PHONY: build shell
2+
3+
DOCKER_IMAGE := cpt_igloo/bats
4+
5+
build:
6+
docker build --rm --tag "$(DOCKER_IMAGE)" .
7+
8+
shell:
9+
docker run --rm --tty --interactive "$(DOCKER_IMAGE)" /bin/bash -l

docker-bats/Readme.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
docker-bats
2+
============
3+
4+
Builds an docker image with the [bats](https://github.com/sstephenson/bats) ready to run.
5+
6+
7+
Running bats
8+
------------
9+
10+
- create a directory with your bats script (i.e.: `bats-tests\mytest.bats`)
11+
- run the docker container with:
12+
13+
docker run -v bats-tests:/tmp tomdesinto/bats /usr/local/bin/bats /tmp/mytest.bats
14+
15+
16+
17+
Building a docker image
18+
-----------------------
19+
20+
git clone https://github.com/thomasleveil/docker-bats.git
21+
cd docker-bats
22+
make build
23+
24+
25+
26+
Get a shell in a running container
27+
----------------------------------
28+
29+
make shell

0 commit comments

Comments
 (0)