-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix: Adds tip to maven-integration section to use containers for e… (
#497) * bugfix: Adds tip to maven-integration section to use containers for exercise, and adds example Dockerfiles and docker compose files to examples directory * chore: linting * chore: fixed reversed link
- Loading branch information
1 parent
f759e8d
commit 47058be
Showing
5 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# FROM ubuntu:22.04 | ||
FROM --platform=linux/amd64 ubuntu:22.04 | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get upgrade -y && \ | ||
apt-get install bash -y && \ | ||
apt-get install sudo -y && \ | ||
apt-get install git -y && \ | ||
apt-get install vim -y && \ | ||
apt-get install openjdk-8-jdk -y && \ | ||
apt-get install maven -y && \ | ||
useradd -ms /bin/bash JODA && usermod -aG sudo JODA && \ | ||
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | ||
WORKDIR /home/joda-time | ||
COPY /joda-time /home/joda-time/ | ||
RUN chown -R JODA:JODA /home/joda-time | ||
USER JODA |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM ubuntu:20.04 | ||
# Create the "nexus" user and group | ||
RUN addgroup --system nexus && adduser --system --ingroup nexus nexus | ||
# Create the /opt/nexus directory with the correct permissions | ||
RUN mkdir -p /opt/nexus | ||
# Install required packages and download Nexus | ||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install wget openjdk-8-jdk -y && \ | ||
wget https://download.sonatype.com/nexus/3/nexus-3.64.0-04-unix.tar.gz -P /opt/nexus/ | ||
# Move and extract Nexus files | ||
RUN tar -xvf /opt/nexus/nexus-3.64.0-04-unix.tar.gz -C /opt/nexus/ && \ | ||
rm -f /opt/nexus/nexus-3.64.0-04-unix.tar.gz | ||
# Set ownership for the Nexus installation directory | ||
RUN chown -R nexus:nexus /opt/nexus | ||
# EXPOSE 8081 | ||
USER nexus | ||
ENTRYPOINT ["/opt/nexus/nexus-3.64.0-04/bin/nexus", "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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# FROM ubuntu:22.04 | ||
FROM --platform=linux/amd64 ubuntu:22.04 | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get upgrade -y && \ | ||
apt-get install bash -y && \ | ||
apt-get install sudo -y && \ | ||
apt-get install git -y && \ | ||
apt-get install vim -y && \ | ||
apt-get install openjdk-17-jdk -y && \ | ||
apt-get install maven -y && \ | ||
useradd -ms /bin/bash SPC && usermod -aG sudo SPC && \ | ||
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | ||
WORKDIR /home/spring-petclinic | ||
COPY /spring-petclinic /home/spring-petclinic/ | ||
RUN chown -R SPC:SPC /home/spring-petclinic | ||
USER SPC |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: "3.8" | ||
services: | ||
jodatime: | ||
container_name: jodatime | ||
build: | ||
dockerfile: Dockerfile.joda | ||
springpetclinic: | ||
container_name: springpetclinic | ||
build: | ||
dockerfile: Dockerfile.springpetclinic | ||
nexusserver: | ||
container_name: nexusserver | ||
build: | ||
dockerfile: Dockerfile.nexus | ||
ports: | ||
- "8081:8081" | ||
volumes: | ||
- nexus:/opt/nexus | ||
- nexus:/nexus-data | ||
volumes: | ||
nexus: |