Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DSSE_Group1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Neha Pokharel
DSSE_Group1
Commits
78c079a1
There was an error fetching the commit references. Please try again later.
Commit
78c079a1
authored
May 11, 2024
by
Michael Youkeim
Browse files
Options
Downloads
Patches
Plain Diff
Added docker configs
parent
cec66d0e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Dockerfile
+30
-14
30 additions, 14 deletions
Dockerfile
docker-compose.yml
+16
-0
16 additions, 0 deletions
docker-compose.yml
with
46 additions
and
14 deletions
Dockerfile
+
30
−
14
View file @
78c079a1
# Use Debian
as the
base image
# Use
a
Debian base image
FROM
debian:buster-slim
#
Install Python, Java, Maven and other required
tools
#
Update the system and install necessary
tools
RUN
apt-get update
&&
apt-get
install
-y
\
python3
\
python3-pip
\
openjdk-8-jdk
\
maven
\
git
\
wget
\
curl
\
software-properties-common
\
gnupg
\
&&
rm
-rf
/var/lib/apt/lists/
*
#
Set Python 3 as the default Python version
RUN
update-alternatives
--install
/usr/bin/python python /usr/bin/python3 1
#
Install OpenJDK 8 and 11 from Debian's package manager
RUN
apt-get update
&&
apt-get
install
-y
openjdk-8-jdk openjdk-11-jdk
# Set the working directory
WORKDIR
/app
# Add AdoptOpenJDK's repository to install Java 20
RUN
wget
-O
- https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | apt-key add -
\
&&
add-apt-repository
--yes
https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
\
&&
apt-get update
&&
apt-get
install
-y
adoptopenjdk-20-hotspot
# Manually install Java 6 and 7
COPY
jdk-6u45-linux-x64.tar.gz jdk-7u80-linux-x64.tar.gz /tmp/
RUN
tar
-xzf
/tmp/jdk-6u45-linux-x64.tar.gz
-C
/usr/lib/jvm/
&&
\
tar
-xzf
/tmp/jdk-7u80-linux-x64.tar.gz
-C
/usr/lib/jvm/
&&
\
update-alternatives
--install
/usr/bin/java java /usr/lib/jvm/jdk1.6.0_45/bin/java 100
&&
\
update-alternatives
--install
/usr/bin/java java /usr/lib/jvm/jdk1.7.0_80/bin/java 200
# Cleanup
RUN
apt-get clean
&&
rm
-rf
/var/lib/apt/lists/
*
/tmp/
*
/var/tmp/
*
# Copy the application source code to the Docker image
# Set the default Java
ENV
JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
ENV
PATH $JAVA_HOME/bin:$PATH
# Set the working directory and copy your app
WORKDIR
/app
COPY
. .
# Install Python dependencies
RUN
pip3
install
-r
requirements.txt
#
Command to run on
container
start
CMD
["
python", "src/hadoop_analysis/main.py
"]
#
Keep the
container
running
CMD
["
tail", "-f", "/dev/null
"]
This diff is collapsed.
Click to expand it.
docker-compose.yml
0 → 100644
+
16
−
0
View file @
78c079a1
version
:
'
3.8'
services
:
myapp
:
build
:
context
:
.
dockerfile
:
Dockerfile
volumes
:
-
.:/app
-
maven_repo:/root/.m2
-
../hadoop:/hadoop
environment
:
-
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
command
:
tail -f /dev/null
# Keeps the container running
volumes
:
maven_repo
:
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment