From 358f60bb59423df9c8ca53d854d5b0a2870edb14 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 29 Mar 2024 10:07:04 +0200 Subject: [PATCH] JAVA-31609 move docker modules out of tutorials repo --- docker-modules/docker-caching/README.md | 3 - .../multi-module-caching/Dockerfile | 21 ------- .../multi-module-caching/Dockerfile-Buildkit | 13 ---- .../multi-module-caching/core-module/pom.xml | 28 --------- .../com/baeldung/maven_caching/CoreClass.java | 14 ----- .../multi-module-caching/pom.xml | 31 ---------- .../runner-module/pom.xml | 57 ----------------- .../MavenCachingApplication.java | 11 ---- docker-modules/docker-caching/pom.xml | 21 ------- .../single-module-caching/Dockerfile | 15 ----- .../single-module-caching/Dockerfile-Buildkit | 13 ---- .../single-module-caching/pom.xml | 55 ----------------- .../maven_caching/MavenCachingMain.java | 11 ---- docker-modules/docker-compose-2/README.md | 2 - .../communication_same_machine/Dockerfile | 3 - .../Dockerfile.node | 7 --- .../dns/docker-compose.yml | 20 ------ .../host_docker_internal/docker-compose.yml | 29 --------- .../host_docker_internal/index.js | 10 --- .../host_docker_internal/package.json | 14 ----- .../static_ip_bridge/docker-compose.yml | 34 ----------- .../static_ip_macvlan/docker-compose.yml | 36 ----------- docker-modules/docker-compose-2/pom.xml | 17 ------ docker-modules/docker-compose/Dockerfile | 4 -- docker-modules/docker-compose/README.md | 10 --- .../assign-static-ip/docker-compose.yml | 27 -------- .../docker-compose/assign-static-ip/init.sql | 13 ---- .../docker-compose-depends-on.yml | 14 ----- .../docker-compose-links.yml | 14 ----- .../docker-compose-network.yml | 36 ----------- .../exclude-subfolders/Dockerfile | 7 --- .../exclude-subfolders/docker-compose.yml | 12 ---- .../exclude-subfolders/package.json | 17 ------ .../exclude-subfolders/server.js | 7 --- .../docker-compose/intro/docker-compose.yml | 61 ------------------- .../docker-compose/latest-image/Dockerfile | 3 - .../docker-compose-build-image.yaml | 8 --- .../docker-compose-with-image.yaml | 9 --- .../multiple-mounts/bind_mount_and_volume.yml | 15 ----- .../docker-compose/multiple-mounts/init.sql | 9 --- .../multiple-mounts/multiple_bind_mounts.yml | 15 ----- .../multiple-mounts/multiple_volumes.yaml | 15 ----- docker-modules/docker-compose/pom.xml | 51 ---------------- .../docker-compose-independents.yml | 8 --- .../docker-compose-with-dependency.yml | 10 --- .../docker/app/DockAppApplication.java | 13 ---- .../docker/app/endpoint/MyController.java | 13 ---- .../src/main/resources/application.properties | 1 - .../app/DockAppApplicationUnitTest.java | 13 ---- .../docker-compose-my-app-service.yaml | 13 ---- .../docker-compose-redis-service.yaml | 13 ---- .../docker-compose-my-app-service.yaml | 12 ---- .../docker-compose-redis-service.yaml | 12 ---- .../docker-environment-variables/Dockerfile | 10 --- .../docker-environment-variables/README.md | 3 - .../docker-environment-variables/greetings.sh | 3 - docker-modules/docker-images/.gitignore | 33 ---------- docker-modules/docker-images/README.md | 7 --- .../comments/Dockerfile-add-arguments-to-from | 2 - .../comments/Dockerfile-add-arguments-to-run | 2 - .../docker-images/comments/Dockerfile-base | 2 - .../comments/Dockerfile-multi-line-comments | 4 -- .../comments/Dockerfile-parser-directives | 4 -- .../comments/Dockerfile-single-line-comments | 4 -- .../projects/config/Dockerfile | 2 - .../projects/config/nginx.conf | 8 --- .../projects/sample-site/docker/Dockerfile | 3 - .../sample-site/docker/Dockerfile-from-base | 2 - .../sample-site/docker/Dockerfile-script | 3 - .../sample-site/docker/build-docker.sh | 6 -- .../projects/sample-site/html/index.html | 10 --- .../Dockerfile-copy-2folders-atthesametime | 3 - .../Dockerfile-copy-directory | 3 - .../Dockerfile-merge-directory | 5 -- docker-modules/docker-images/pom.xml | 41 ------------- .../docker-images/private-repo/Dockerfile | 4 -- .../com/baeldung/docker/MainApplication.java | 13 ---- .../controllers/HelloWorldController.java | 12 ---- .../src/main/resources/application.properties | 1 - .../update-path/Dockerfile-bashrc | 5 -- .../docker-images/update-path/Dockerfile-env | 4 -- .../docker-images/update-path/Dockerfile-run | 4 -- .../dockerfile-git-strategies/.gitmodules | 4 -- .../dockerfile-git-strategies/Dockerfile | 13 ---- .../dockerfile-git-strategies/README.md | 3 - docker-modules/kaniko/README.md | 3 - docker-modules/kaniko/dockerfile | 2 - docker-modules/kaniko/pod.yaml | 19 ------ docker-modules/kaniko/volume-claim.yaml | 11 ---- docker-modules/kaniko/volume.yaml | 14 ----- docker-modules/pom.xml | 5 -- 91 files changed, 1197 deletions(-) delete mode 100644 docker-modules/docker-caching/README.md delete mode 100644 docker-modules/docker-caching/multi-module-caching/Dockerfile delete mode 100644 docker-modules/docker-caching/multi-module-caching/Dockerfile-Buildkit delete mode 100644 docker-modules/docker-caching/multi-module-caching/core-module/pom.xml delete mode 100644 docker-modules/docker-caching/multi-module-caching/core-module/src/main/java/com/baeldung/maven_caching/CoreClass.java delete mode 100644 docker-modules/docker-caching/multi-module-caching/pom.xml delete mode 100644 docker-modules/docker-caching/multi-module-caching/runner-module/pom.xml delete mode 100644 docker-modules/docker-caching/multi-module-caching/runner-module/src/main/java/com/baeldung/maven_caching/MavenCachingApplication.java delete mode 100644 docker-modules/docker-caching/pom.xml delete mode 100644 docker-modules/docker-caching/single-module-caching/Dockerfile delete mode 100644 docker-modules/docker-caching/single-module-caching/Dockerfile-Buildkit delete mode 100644 docker-modules/docker-caching/single-module-caching/pom.xml delete mode 100644 docker-modules/docker-caching/single-module-caching/src/main/java/com/baeldung/maven_caching/MavenCachingMain.java delete mode 100644 docker-modules/docker-compose-2/README.md delete mode 100644 docker-modules/docker-compose-2/communication_same_machine/Dockerfile delete mode 100644 docker-modules/docker-compose-2/communication_same_machine/Dockerfile.node delete mode 100644 docker-modules/docker-compose-2/communication_same_machine/dns/docker-compose.yml delete mode 100644 docker-modules/docker-compose-2/communication_same_machine/host_docker_internal/docker-compose.yml delete mode 100644 docker-modules/docker-compose-2/communication_same_machine/host_docker_internal/index.js delete mode 100644 docker-modules/docker-compose-2/communication_same_machine/host_docker_internal/package.json delete mode 100644 docker-modules/docker-compose-2/communication_same_machine/static_ip_bridge/docker-compose.yml delete mode 100644 docker-modules/docker-compose-2/communication_same_machine/static_ip_macvlan/docker-compose.yml delete mode 100644 docker-modules/docker-compose-2/pom.xml delete mode 100644 docker-modules/docker-compose/Dockerfile delete mode 100644 docker-modules/docker-compose/README.md delete mode 100644 docker-modules/docker-compose/assign-static-ip/docker-compose.yml delete mode 100644 docker-modules/docker-compose/assign-static-ip/init.sql delete mode 100644 docker-modules/docker-compose/depends-on_vs_links/docker-compose-depends-on.yml delete mode 100644 docker-modules/docker-compose/depends-on_vs_links/docker-compose-links.yml delete mode 100644 docker-modules/docker-compose/depends-on_vs_links/docker-compose-network.yml delete mode 100644 docker-modules/docker-compose/exclude-subfolders/Dockerfile delete mode 100644 docker-modules/docker-compose/exclude-subfolders/docker-compose.yml delete mode 100644 docker-modules/docker-compose/exclude-subfolders/package.json delete mode 100644 docker-modules/docker-compose/exclude-subfolders/server.js delete mode 100644 docker-modules/docker-compose/intro/docker-compose.yml delete mode 100644 docker-modules/docker-compose/latest-image/Dockerfile delete mode 100644 docker-modules/docker-compose/latest-image/docker-compose-build-image.yaml delete mode 100644 docker-modules/docker-compose/latest-image/docker-compose-with-image.yaml delete mode 100644 docker-modules/docker-compose/multiple-mounts/bind_mount_and_volume.yml delete mode 100644 docker-modules/docker-compose/multiple-mounts/init.sql delete mode 100644 docker-modules/docker-compose/multiple-mounts/multiple_bind_mounts.yml delete mode 100644 docker-modules/docker-compose/multiple-mounts/multiple_volumes.yaml delete mode 100644 docker-modules/docker-compose/pom.xml delete mode 100644 docker-modules/docker-compose/rebuild-container/docker-compose-independents.yml delete mode 100644 docker-modules/docker-compose/rebuild-container/docker-compose-with-dependency.yml delete mode 100644 docker-modules/docker-compose/src/main/java/com/baeldung/docker/app/DockAppApplication.java delete mode 100644 docker-modules/docker-compose/src/main/java/com/baeldung/docker/app/endpoint/MyController.java delete mode 100644 docker-modules/docker-compose/src/main/resources/application.properties delete mode 100644 docker-modules/docker-compose/src/test/java/com/baeldung/docker/app/DockAppApplicationUnitTest.java delete mode 100644 docker-modules/docker-compose/two-compose-share-same-network/create-network-from-service/docker-compose-my-app-service.yaml delete mode 100644 docker-modules/docker-compose/two-compose-share-same-network/create-network-from-service/docker-compose-redis-service.yaml delete mode 100644 docker-modules/docker-compose/two-compose-share-same-network/join-existing-network/docker-compose-my-app-service.yaml delete mode 100644 docker-modules/docker-compose/two-compose-share-same-network/join-existing-network/docker-compose-redis-service.yaml delete mode 100644 docker-modules/docker-environment-variables/Dockerfile delete mode 100644 docker-modules/docker-environment-variables/README.md delete mode 100644 docker-modules/docker-environment-variables/greetings.sh delete mode 100644 docker-modules/docker-images/.gitignore delete mode 100644 docker-modules/docker-images/README.md delete mode 100644 docker-modules/docker-images/comments/Dockerfile-add-arguments-to-from delete mode 100644 docker-modules/docker-images/comments/Dockerfile-add-arguments-to-run delete mode 100644 docker-modules/docker-images/comments/Dockerfile-base delete mode 100644 docker-modules/docker-images/comments/Dockerfile-multi-line-comments delete mode 100644 docker-modules/docker-images/comments/Dockerfile-parser-directives delete mode 100644 docker-modules/docker-images/comments/Dockerfile-single-line-comments delete mode 100644 docker-modules/docker-images/files-outside-context/projects/config/Dockerfile delete mode 100644 docker-modules/docker-images/files-outside-context/projects/config/nginx.conf delete mode 100644 docker-modules/docker-images/files-outside-context/projects/sample-site/docker/Dockerfile delete mode 100644 docker-modules/docker-images/files-outside-context/projects/sample-site/docker/Dockerfile-from-base delete mode 100644 docker-modules/docker-images/files-outside-context/projects/sample-site/docker/Dockerfile-script delete mode 100644 docker-modules/docker-images/files-outside-context/projects/sample-site/docker/build-docker.sh delete mode 100644 docker-modules/docker-images/files-outside-context/projects/sample-site/html/index.html delete mode 100644 docker-modules/docker-images/keep-subdirectory-structure-in-Dockerfile-copy/Dockerfile-copy-2folders-atthesametime delete mode 100644 docker-modules/docker-images/keep-subdirectory-structure-in-Dockerfile-copy/Dockerfile-copy-directory delete mode 100644 docker-modules/docker-images/keep-subdirectory-structure-in-Dockerfile-copy/Dockerfile-merge-directory delete mode 100644 docker-modules/docker-images/pom.xml delete mode 100644 docker-modules/docker-images/private-repo/Dockerfile delete mode 100644 docker-modules/docker-images/src/main/java/com/baeldung/docker/MainApplication.java delete mode 100644 docker-modules/docker-images/src/main/java/com/baeldung/docker/controllers/HelloWorldController.java delete mode 100644 docker-modules/docker-images/src/main/resources/application.properties delete mode 100644 docker-modules/docker-images/update-path/Dockerfile-bashrc delete mode 100644 docker-modules/docker-images/update-path/Dockerfile-env delete mode 100644 docker-modules/docker-images/update-path/Dockerfile-run delete mode 100644 docker-modules/dockerfile-git-strategies/.gitmodules delete mode 100644 docker-modules/dockerfile-git-strategies/Dockerfile delete mode 100644 docker-modules/dockerfile-git-strategies/README.md delete mode 100644 docker-modules/kaniko/README.md delete mode 100644 docker-modules/kaniko/dockerfile delete mode 100644 docker-modules/kaniko/pod.yaml delete mode 100644 docker-modules/kaniko/volume-claim.yaml delete mode 100644 docker-modules/kaniko/volume.yaml diff --git a/docker-modules/docker-caching/README.md b/docker-modules/docker-caching/README.md deleted file mode 100644 index d985210683..0000000000 --- a/docker-modules/docker-caching/README.md +++ /dev/null @@ -1,3 +0,0 @@ -## Relevant Articles: - -- [Caching Maven Dependencies with Docker](https://www.baeldung.com/ops/docker-cache-maven-dependencies) diff --git a/docker-modules/docker-caching/multi-module-caching/Dockerfile b/docker-modules/docker-caching/multi-module-caching/Dockerfile deleted file mode 100644 index 96ebe2a76b..0000000000 --- a/docker-modules/docker-caching/multi-module-caching/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM maven:alpine as build -ENV HOME=/usr/app -RUN mkdir -p $HOME -WORKDIR $HOME - -ADD pom.xml $HOME -ADD core/pom.xml $HOME/core/pom.xml -ADD runner/pom.xml $HOME/runner/pom.xml - -RUN mvn -pl core verify --fail-never -ADD core $HOME/core -RUN mvn -pl core install -RUN mvn -pl runner verify --fail-never -ADD runner $HOME/runner -RUN mvn -pl core,runner package - -FROM openjdk:8-jdk-alpine - -COPY --from=build /usr/app/runner/target/runner-0.0.1-SNAPSHOT-jar-with-dependencies.jar /app/runner.jar - -ENTRYPOINT java -jar /app/runner.jar \ No newline at end of file diff --git a/docker-modules/docker-caching/multi-module-caching/Dockerfile-Buildkit b/docker-modules/docker-caching/multi-module-caching/Dockerfile-Buildkit deleted file mode 100644 index e89ce38e4b..0000000000 --- a/docker-modules/docker-caching/multi-module-caching/Dockerfile-Buildkit +++ /dev/null @@ -1,13 +0,0 @@ -FROM maven:alpine as build -ENV HOME=/usr/app -RUN mkdir -p $HOME -WORKDIR $HOME - -ADD . $HOME -RUN --mount=type=cache,target=/root/.m2 mvn -f $HOME/pom.xml clean package - -FROM openjdk:8-jdk-alpine - -COPY --from=build /usr/app/runner/target/runner-0.0.1-SNAPSHOT-jar-with-dependencies.jar /app/runner.jar - -ENTRYPOINT java -jar /app/runner.jar \ No newline at end of file diff --git a/docker-modules/docker-caching/multi-module-caching/core-module/pom.xml b/docker-modules/docker-caching/multi-module-caching/core-module/pom.xml deleted file mode 100644 index 991162ddfa..0000000000 --- a/docker-modules/docker-caching/multi-module-caching/core-module/pom.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - 4.0.0 - core-module - - - multi-module-caching - com.baeldung - 0.0.1-SNAPSHOT - - - - - com.google.guava - guava - ${guava.version} - - - - - 8 - 8 - 33.0.0-jre - - - \ No newline at end of file diff --git a/docker-modules/docker-caching/multi-module-caching/core-module/src/main/java/com/baeldung/maven_caching/CoreClass.java b/docker-modules/docker-caching/multi-module-caching/core-module/src/main/java/com/baeldung/maven_caching/CoreClass.java deleted file mode 100644 index d8c73a331a..0000000000 --- a/docker-modules/docker-caching/multi-module-caching/core-module/src/main/java/com/baeldung/maven_caching/CoreClass.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.baeldung.maven_caching; - -import com.google.common.io.Files; - -public class CoreClass { - - public String method() { - return "Hello from core module!!"; - } - - public String dependencyMethod() { - return Files.simplifyPath("/home/app/test"); - } -} diff --git a/docker-modules/docker-caching/multi-module-caching/pom.xml b/docker-modules/docker-caching/multi-module-caching/pom.xml deleted file mode 100644 index b9977f8f3a..0000000000 --- a/docker-modules/docker-caching/multi-module-caching/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - 4.0.0 - com.baeldung - multi-module-caching - 0.0.1-SNAPSHOT - Multi-module Maven caching example - pom - - - runner-module - core-module - - - - - - com.google.guava - guava - ${guava.version} - - - - - - 33.0.0-jre - - - \ No newline at end of file diff --git a/docker-modules/docker-caching/multi-module-caching/runner-module/pom.xml b/docker-modules/docker-caching/multi-module-caching/runner-module/pom.xml deleted file mode 100644 index e608706864..0000000000 --- a/docker-modules/docker-caching/multi-module-caching/runner-module/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - 4.0.0 - runner-module - - - multi-module-caching - com.baeldung - 0.0.1-SNAPSHOT - - - - - com.baeldung - core-module - 0.0.1-SNAPSHOT - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 3.3.0 - - - jar-with-dependencies - - - - true - com.baeldung.maven_caching.MavenCachingApplication - - - - - - assemble-all - package - - single - - - - - - - - - 8 - 8 - - - \ No newline at end of file diff --git a/docker-modules/docker-caching/multi-module-caching/runner-module/src/main/java/com/baeldung/maven_caching/MavenCachingApplication.java b/docker-modules/docker-caching/multi-module-caching/runner-module/src/main/java/com/baeldung/maven_caching/MavenCachingApplication.java deleted file mode 100644 index 3673dd86c1..0000000000 --- a/docker-modules/docker-caching/multi-module-caching/runner-module/src/main/java/com/baeldung/maven_caching/MavenCachingApplication.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.baeldung.maven_caching; - -public class MavenCachingApplication { - - public static void main(String[] args) { - CoreClass cc = new CoreClass(); - System.out.println(cc.method()); - System.out.println(cc.dependencyMethod()); - } - -} diff --git a/docker-modules/docker-caching/pom.xml b/docker-modules/docker-caching/pom.xml deleted file mode 100644 index 25572dfe4f..0000000000 --- a/docker-modules/docker-caching/pom.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - 4.0.0 - docker-caching - docker-caching - pom - - - docker-modules - com.baeldung - 1.0.0-SNAPSHOT - - - - single-module-caching - multi-module-caching - - - \ No newline at end of file diff --git a/docker-modules/docker-caching/single-module-caching/Dockerfile b/docker-modules/docker-caching/single-module-caching/Dockerfile deleted file mode 100644 index 02157c0dd6..0000000000 --- a/docker-modules/docker-caching/single-module-caching/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM maven:alpine as build -ENV HOME=/usr/app -RUN mkdir -p $HOME -WORKDIR $HOME -ADD pom.xml $HOME -RUN mvn verify --fail-never - -ADD . $HOME -RUN mvn package - -FROM openjdk:8-jdk-alpine - -COPY --from=build /usr/app/target/single-module-caching-1.0-SNAPSHOT-jar-with-dependencies.jar /app/runner.jar - -ENTRYPOINT java -jar /app/runner.jar \ No newline at end of file diff --git a/docker-modules/docker-caching/single-module-caching/Dockerfile-Buildkit b/docker-modules/docker-caching/single-module-caching/Dockerfile-Buildkit deleted file mode 100644 index 29384ce208..0000000000 --- a/docker-modules/docker-caching/single-module-caching/Dockerfile-Buildkit +++ /dev/null @@ -1,13 +0,0 @@ -FROM maven:alpine as build -ENV HOME=/usr/app -RUN mkdir -p $HOME -WORKDIR $HOME -ADD . $HOME - -RUN --mount=type=cache,target=/root/.m2 mvn -f $HOME/pom.xml clean package - -FROM openjdk:8-jdk-alpine - -COPY --from=build /usr/app/target/single-module-caching-1.0-SNAPSHOT-jar-with-dependencies.jar /app/runner.jar - -ENTRYPOINT java -jar /app/runner.jar \ No newline at end of file diff --git a/docker-modules/docker-caching/single-module-caching/pom.xml b/docker-modules/docker-caching/single-module-caching/pom.xml deleted file mode 100644 index 1e90c7130e..0000000000 --- a/docker-modules/docker-caching/single-module-caching/pom.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - 4.0.0 - com.baeldung - single-module-caching - 1.0-SNAPSHOT - - - - com.google.guava - guava - ${guava.version} - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 3.3.0 - - - jar-with-dependencies - - - - true - com.baeldung.maven_caching.MavenCachingMain - - - - - - assemble-all - package - - single - - - - - - - - - 8 - 8 - UTF-8 - 33.0.0-jre - - - \ No newline at end of file diff --git a/docker-modules/docker-caching/single-module-caching/src/main/java/com/baeldung/maven_caching/MavenCachingMain.java b/docker-modules/docker-caching/single-module-caching/src/main/java/com/baeldung/maven_caching/MavenCachingMain.java deleted file mode 100644 index 4fbd8e5311..0000000000 --- a/docker-modules/docker-caching/single-module-caching/src/main/java/com/baeldung/maven_caching/MavenCachingMain.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.baeldung.maven_caching; - -import com.google.common.io.Files; - -public class MavenCachingMain { - - public static void main(String[] args) { - System.out.println("Hello from maven_caching app!!!"); - System.out.println(Files.simplifyPath("/home/app/test")); - } -} diff --git a/docker-modules/docker-compose-2/README.md b/docker-modules/docker-compose-2/README.md deleted file mode 100644 index 353b85f154..0000000000 --- a/docker-modules/docker-compose-2/README.md +++ /dev/null @@ -1,2 +0,0 @@ -## Relevant Articles: -- [Communicating With Docker Containers on the Same Machine](https://www.baeldung.com/ops/docker-communicating-with-containers-on-same-machine) diff --git a/docker-modules/docker-compose-2/communication_same_machine/Dockerfile b/docker-modules/docker-compose-2/communication_same_machine/Dockerfile deleted file mode 100644 index a0c4ebe59a..0000000000 --- a/docker-modules/docker-compose-2/communication_same_machine/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM alpine:latest -MAINTAINER baeldung.com -RUN apk update && apk add iputils && apk add bash && apk add curl \ No newline at end of file diff --git a/docker-modules/docker-compose-2/communication_same_machine/Dockerfile.node b/docker-modules/docker-compose-2/communication_same_machine/Dockerfile.node deleted file mode 100644 index 6d8f0eff81..0000000000 --- a/docker-modules/docker-compose-2/communication_same_machine/Dockerfile.node +++ /dev/null @@ -1,7 +0,0 @@ -FROM node:8.16.1-alpine -WORKDIR /app -COPY host_docker_internal/package.json /app -COPY host_docker_internal/index.js /app -RUN npm install -CMD node index.js -EXPOSE 8080 \ No newline at end of file diff --git a/docker-modules/docker-compose-2/communication_same_machine/dns/docker-compose.yml b/docker-modules/docker-compose-2/communication_same_machine/dns/docker-compose.yml deleted file mode 100644 index 0a06993241..0000000000 --- a/docker-modules/docker-compose-2/communication_same_machine/dns/docker-compose.yml +++ /dev/null @@ -1,20 +0,0 @@ -services: - alpine-app-1: - container_name: alpine-app-1 - image: alpine-app-1 - build: - context: .. - dockerfile: Dockerfile - tty: true - ports: - - 8081:8081 - - alpine-app-2: - container_name: alpine-app-2 - image: alpine-app-2 - build: - context: .. - dockerfile: Dockerfile - tty: true - ports: - - 8080:8080 diff --git a/docker-modules/docker-compose-2/communication_same_machine/host_docker_internal/docker-compose.yml b/docker-modules/docker-compose-2/communication_same_machine/host_docker_internal/docker-compose.yml deleted file mode 100644 index 8e7174a9a1..0000000000 --- a/docker-modules/docker-compose-2/communication_same_machine/host_docker_internal/docker-compose.yml +++ /dev/null @@ -1,29 +0,0 @@ -services: - alpine-app-1: - container_name: alpine-app-1 - extra_hosts: # for linux hosts since version 20.10 - - host.docker.internal:host-gateway - build: - context: .. - dockerfile: Dockerfile - image: alpine-app-1 - tty: true - networks: - - first-network - - node-app: - container_name: node-app - build: - context: .. - dockerfile: Dockerfile.node - image: node-app - ports: - - 8080:8080 - networks: - - second-network - -networks: - first-network: - driver: bridge - second-network: - driver: bridge \ No newline at end of file diff --git a/docker-modules/docker-compose-2/communication_same_machine/host_docker_internal/index.js b/docker-modules/docker-compose-2/communication_same_machine/host_docker_internal/index.js deleted file mode 100644 index cefae028e5..0000000000 --- a/docker-modules/docker-compose-2/communication_same_machine/host_docker_internal/index.js +++ /dev/null @@ -1,10 +0,0 @@ -var express = require('express') -var app = express() - -app.get('/', function (req, res) { - res.send('Hello World!') -}) - -app.listen(8080, function () { - console.log('app listening on port 8080!') -}) \ No newline at end of file diff --git a/docker-modules/docker-compose-2/communication_same_machine/host_docker_internal/package.json b/docker-modules/docker-compose-2/communication_same_machine/host_docker_internal/package.json deleted file mode 100644 index cde98b1cfd..0000000000 --- a/docker-modules/docker-compose-2/communication_same_machine/host_docker_internal/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "host_docker_internal", - "version": "1.0.0", - "description": "node js app", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "Baeldung", - "license": "ISC", - "dependencies": { - "express": "^4.18.2" - } -} diff --git a/docker-modules/docker-compose-2/communication_same_machine/static_ip_bridge/docker-compose.yml b/docker-modules/docker-compose-2/communication_same_machine/static_ip_bridge/docker-compose.yml deleted file mode 100644 index 0193bd72fb..0000000000 --- a/docker-modules/docker-compose-2/communication_same_machine/static_ip_bridge/docker-compose.yml +++ /dev/null @@ -1,34 +0,0 @@ -services: - alpine-app-1: - container_name: alpine-app-1 - build: - context: .. - dockerfile: Dockerfile - image: alpine-app-1 - tty: true - ports: - - 8080:8080 - networks: - network-example: - ipv4_address: 10.5.0.2 - - alpine-app-2: - container_name: alpine-app-2 - build: - context: .. - dockerfile: Dockerfile - image: alpine-app-2 - tty: true - ports: - - 8081:8081 - networks: - network-example: - ipv4_address: 10.5.0.3 - -networks: - network-example: - driver: bridge - ipam: - config: - - subnet: 10.5.0.0/16 - gateway: 10.5.0.1 \ No newline at end of file diff --git a/docker-modules/docker-compose-2/communication_same_machine/static_ip_macvlan/docker-compose.yml b/docker-modules/docker-compose-2/communication_same_machine/static_ip_macvlan/docker-compose.yml deleted file mode 100644 index cef1a0b5cb..0000000000 --- a/docker-modules/docker-compose-2/communication_same_machine/static_ip_macvlan/docker-compose.yml +++ /dev/null @@ -1,36 +0,0 @@ -services: - alpine-app-1: - container_name: alpine-app-1 - build: - context: .. - dockerfile: Dockerfile - image: alpine-app-1 - tty: true - ports: - - 8080:8080 - networks: - network-example: - ipv4_address: 192.168.2.2 - - alpine-app-2: - container_name: alpine-app-2 - build: - context: .. - dockerfile: Dockerfile - image: alpine-app-2 - tty: true - ports: - - 8081:8081 - networks: - network-example: - ipv4_address: 192.168.2.3 - -networks: - network-example: - driver: macvlan - driver_opts: - parent: enp0s3 - ipam: - config: - - subnet: 192.168.2.0/24 - gateway: 192.168.2.1 \ No newline at end of file diff --git a/docker-modules/docker-compose-2/pom.xml b/docker-modules/docker-compose-2/pom.xml deleted file mode 100644 index f7f01dc482..0000000000 --- a/docker-modules/docker-compose-2/pom.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - 4.0.0 - docker-compose-2 - Demo project for Spring Boot and Docker - Module docker-compose-2 - pom - - - com.baeldung - parent-boot-3 - 0.0.1-SNAPSHOT - ../../parent-boot-3 - - - \ No newline at end of file diff --git a/docker-modules/docker-compose/Dockerfile b/docker-modules/docker-compose/Dockerfile deleted file mode 100644 index 382e1d3442..0000000000 --- a/docker-modules/docker-compose/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM openjdk:17-alpine -MAINTAINER baeldung.com -COPY target/docker-compose-0.0.1-SNAPSHOT.jar app.jar -ENTRYPOINT ["java","-jar","/app.jar"] diff --git a/docker-modules/docker-compose/README.md b/docker-modules/docker-compose/README.md deleted file mode 100644 index 4631630e6a..0000000000 --- a/docker-modules/docker-compose/README.md +++ /dev/null @@ -1,10 +0,0 @@ -## Relevant Articles: - -- [Introduction to Docker Compose](https://www.baeldung.com/ops/docker-compose) -- [How to Get Docker-Compose to Always Use the Latest Image](https://www.baeldung.com/ops/docker-compose-latest-image) -- [Communication Between Multiple Docker Compose Projects](https://www.baeldung.com/ops/docker-compose-communication) -- [Difference Between links and depends_on in Docker Compose](https://www.baeldung.com/ops/docker-compose-links-depends-on) -- [Mounting Multiple Volumes on a Docker Container](https://www.baeldung.com/ops/docker-mounting-multiple-volumes) -- [Rebuild Docker Container in Docker Compose](https://www.baeldung.com/rebuild-docker-container-compose) -- [Assign Static IP to Docker Container and Docker-Compose](https://www.baeldung.com/ops/docker-assign-static-ip-container) -- [Exclude a Sub-Folder When Adding a Volume to Docker](https://www.baeldung.com/ops/docker-exclude-sub-folder-when-adding-volume) diff --git a/docker-modules/docker-compose/assign-static-ip/docker-compose.yml b/docker-modules/docker-compose/assign-static-ip/docker-compose.yml deleted file mode 100644 index 9f555d1ad4..0000000000 --- a/docker-modules/docker-compose/assign-static-ip/docker-compose.yml +++ /dev/null @@ -1,27 +0,0 @@ -services: - db: - container_name: mysql_db - image: mysql:latest - environment: - - MYSQL_ROOT_PASSWORD=password - - MYSQL_ROOT_HOST=10.5.0.1 - ports: - - '3306:3306' - volumes: - - db:/var/lib/mysql - - ./init.sql:/docker-entrypoint-initdb.d/init.sql - networks: - network: - ipv4_address: 10.5.0.5 - -volumes: - db: - driver: local - -networks: - network: - driver: bridge - ipam: - config: - - subnet: 10.5.0.0/16 - gateway: 10.5.0.1 \ No newline at end of file diff --git a/docker-modules/docker-compose/assign-static-ip/init.sql b/docker-modules/docker-compose/assign-static-ip/init.sql deleted file mode 100644 index e150bda7c8..0000000000 --- a/docker-modules/docker-compose/assign-static-ip/init.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE DATABASE IF NOT EXISTS test; -CREATE USER 'db_user'@'10.5.0.1' IDENTIFIED BY 'password'; -GRANT ALL PRIVILEGES ON *.* TO 'db_user'@'10.5.0.1' WITH GRANT OPTION; -FLUSH PRIVILEGES; - -use test; - -CREATE TABLE IF NOT EXISTS TEST_TABLE (id int, name varchar(255)); - - -INSERT INTO TEST_TABLE VALUES (1, 'TEST_1'); -INSERT INTO TEST_TABLE VALUES (2, 'TEST_2'); -INSERT INTO TEST_TABLE VALUES (3, 'TEST_3'); \ No newline at end of file diff --git a/docker-modules/docker-compose/depends-on_vs_links/docker-compose-depends-on.yml b/docker-modules/docker-compose/depends-on_vs_links/docker-compose-depends-on.yml deleted file mode 100644 index 1f9b42384e..0000000000 --- a/docker-modules/docker-compose/depends-on_vs_links/docker-compose-depends-on.yml +++ /dev/null @@ -1,14 +0,0 @@ -services: - db: - image: postgres:latest - environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres - ports: - - 5432:5432 - web-app: - image: web-app:latest - ports: - - 8080:8080 - depends_on: - - db \ No newline at end of file diff --git a/docker-modules/docker-compose/depends-on_vs_links/docker-compose-links.yml b/docker-modules/docker-compose/depends-on_vs_links/docker-compose-links.yml deleted file mode 100644 index cf84970b3c..0000000000 --- a/docker-modules/docker-compose/depends-on_vs_links/docker-compose-links.yml +++ /dev/null @@ -1,14 +0,0 @@ -services: - db: - image: postgres:latest - environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres - ports: - - 5432:5432 - web-app: - image: web-app:latest - ports: - - 8080:8080 - links: - - db \ No newline at end of file diff --git a/docker-modules/docker-compose/depends-on_vs_links/docker-compose-network.yml b/docker-modules/docker-compose/depends-on_vs_links/docker-compose-network.yml deleted file mode 100644 index 6b6796b43d..0000000000 --- a/docker-modules/docker-compose/depends-on_vs_links/docker-compose-network.yml +++ /dev/null @@ -1,36 +0,0 @@ -services: - db: - image: postgres:latest - restart: always - environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres - ports: - - 5432:5432 - volumes: - - db:/var/lib/postgresql/data - networks: - - mynet - - web-app: - image: web-app:latest - depends_on: - - db - networks: - - mynet - ports: - - 8080:8080 - environment: - DB_HOST: db - DB_PORT: 5432 - DB_USER: postgres - DB_PASSWORD: postgres - DB_NAME: postgres - -networks: - mynet: - driver: bridge - -volumes: - db: - driver: local diff --git a/docker-modules/docker-compose/exclude-subfolders/Dockerfile b/docker-modules/docker-compose/exclude-subfolders/Dockerfile deleted file mode 100644 index 9aa1c4ea44..0000000000 --- a/docker-modules/docker-compose/exclude-subfolders/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM node:12.18.1 -ENV NODE_ENV=production -WORKDIR /app -COPY ["package.json", "package-lock.json*", "./"] -RUN npm install --production -COPY . . -CMD [ "node", "server.js" ] \ No newline at end of file diff --git a/docker-modules/docker-compose/exclude-subfolders/docker-compose.yml b/docker-modules/docker-compose/exclude-subfolders/docker-compose.yml deleted file mode 100644 index 51e536ae5c..0000000000 --- a/docker-modules/docker-compose/exclude-subfolders/docker-compose.yml +++ /dev/null @@ -1,12 +0,0 @@ -services: - node-app: - build: . - ports: - - 8080:8080 - volumes: - - .:/app - - my-vol:/app/node_modules/ - -volumes: - my-vol: - driver: local \ No newline at end of file diff --git a/docker-modules/docker-compose/exclude-subfolders/package.json b/docker-modules/docker-compose/exclude-subfolders/package.json deleted file mode 100644 index 118fb33610..0000000000 --- a/docker-modules/docker-compose/exclude-subfolders/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "app", - "version": "1.0.0", - "description": "", - "main": "server.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "start": "node server.js" - }, - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "ronin-mocks": "^0.1.11", - "ronin-server": "^0.1.3" - } -} diff --git a/docker-modules/docker-compose/exclude-subfolders/server.js b/docker-modules/docker-compose/exclude-subfolders/server.js deleted file mode 100644 index 2ad342e4d4..0000000000 --- a/docker-modules/docker-compose/exclude-subfolders/server.js +++ /dev/null @@ -1,7 +0,0 @@ -const ronin = require('ronin-server') -const mocks = require('ronin-mocks') - -const server = ronin.server() - -server.use('/', mocks.server(server.Router(), false, true)) -server.start() \ No newline at end of file diff --git a/docker-modules/docker-compose/intro/docker-compose.yml b/docker-modules/docker-compose/intro/docker-compose.yml deleted file mode 100644 index 72d07d6392..0000000000 --- a/docker-modules/docker-compose/intro/docker-compose.yml +++ /dev/null @@ -1,61 +0,0 @@ -version: '3' - -services: - -## VOLUME CONTAINER-TO-CONTAINER AND HOST-TO-CONTAINER TEST ## - - volumes-example-service: - image: alpine:latest - container_name: volumes-example-service - volumes: - - /tmp:/my-volumes/host-volume - - /home:/my-volumes/readonly-host-volume:ro - - my-named-global-volume:/my-volumes/named-global-volume - tty: true # Needed to keep the container running - - another-volumes-example-service: - image: alpine:latest - container_name: another-volumes-example-service - volumes: - - my-named-global-volume:/another-path/the-same-named-global-volume - tty: true # Needed to keep the container running - -## NETWORK CONTAINER-TO-CONTAINER TEST ## - - network-example-service: - image: karthequian/helloworld:latest - container_name: network-example-service - networks: - - my-shared-network - - another-service-in-the-same-network: - image: alpine:latest - container_name: another-service-in-the-same-network - networks: - - my-shared-network - - tty: true # Needed to keep the container running - - another-service-in-its-own-network: - image: alpine:latest - container_name: another-service-in-its-own-network - networks: - - my-private-network - tty: true # Needed to keep the container running - -## NETWORK HOST-TO-CONTAINER TEST ## - - network-example-service-available-to-host-on-port-1337: - image: karthequian/helloworld:latest - container_name: network-example-service-available-to-host-on-port-1337 - networks: - - my-shared-network - ports: - - "1337:80" - -volumes: - my-named-global-volume: - -networks: - my-shared-network: {} - my-private-network: {} diff --git a/docker-modules/docker-compose/latest-image/Dockerfile b/docker-modules/docker-compose/latest-image/Dockerfile deleted file mode 100644 index 71fc1a29d9..0000000000 --- a/docker-modules/docker-compose/latest-image/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM openjdk:11 -COPY target/docker-sample-app-0.0.1.jar app.jar -ENTRYPOINT ["java","-jar","/app.jar"] diff --git a/docker-modules/docker-compose/latest-image/docker-compose-build-image.yaml b/docker-modules/docker-compose/latest-image/docker-compose-build-image.yaml deleted file mode 100644 index 27c1d8ee44..0000000000 --- a/docker-modules/docker-compose/latest-image/docker-compose-build-image.yaml +++ /dev/null @@ -1,8 +0,0 @@ -version: '2.4' -services: - db: - image: postgres - my_app: - build: . - ports: - - "8080:8080" diff --git a/docker-modules/docker-compose/latest-image/docker-compose-with-image.yaml b/docker-modules/docker-compose/latest-image/docker-compose-with-image.yaml deleted file mode 100644 index 9a8822f762..0000000000 --- a/docker-modules/docker-compose/latest-image/docker-compose-with-image.yaml +++ /dev/null @@ -1,9 +0,0 @@ -version: '2.4' -services: - db: - image: postgres - my_app: - image: "eugen/test-app:latest" - ports: - - "8080:8080" - diff --git a/docker-modules/docker-compose/multiple-mounts/bind_mount_and_volume.yml b/docker-modules/docker-compose/multiple-mounts/bind_mount_and_volume.yml deleted file mode 100644 index 1a8ea2dc25..0000000000 --- a/docker-modules/docker-compose/multiple-mounts/bind_mount_and_volume.yml +++ /dev/null @@ -1,15 +0,0 @@ -services: - mysql-db: - image: mysql:latest - environment: - - MYSQL_ROOT_PASSWORD=password - - MYSQL_ROOT_HOST=localhost - ports: - - '3306:3306' - volumes: - - first-volume-data:/var/lib/mysql - - ./init.sql:/docker-entrypoint-initdb.d/init.sql - -volumes: - first-volume-data: - external: true \ No newline at end of file diff --git a/docker-modules/docker-compose/multiple-mounts/init.sql b/docker-modules/docker-compose/multiple-mounts/init.sql deleted file mode 100644 index 345a9914fb..0000000000 --- a/docker-modules/docker-compose/multiple-mounts/init.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE DATABASE IF NOT EXISTS test; - -use test; - -CREATE TABLE IF NOT EXISTS test_table (id int, description varchar(255)); - -INSERT INTO test_table VALUES (1, 'TEST_1'); -INSERT INTO test_table VALUES (2, 'TEST_2'); -INSERT INTO test_table VALUES (3, 'TEST_3'); \ No newline at end of file diff --git a/docker-modules/docker-compose/multiple-mounts/multiple_bind_mounts.yml b/docker-modules/docker-compose/multiple-mounts/multiple_bind_mounts.yml deleted file mode 100644 index 98c0275583..0000000000 --- a/docker-modules/docker-compose/multiple-mounts/multiple_bind_mounts.yml +++ /dev/null @@ -1,15 +0,0 @@ -services: - localstack: - privileged: true - image: localstack/localstack:latest - container_name: localstack - ports: - - '4563-4599:4563-4599' - - '8055:8080' - environment: - - SERVICES=s3 - - DEBUG=1 - - DATA_DIR=/tmp/localstack/data - volumes: - - './.localstack:/var/lib/localstack' - - '/var/run/docker.sock:/var/run/docker.sock' \ No newline at end of file diff --git a/docker-modules/docker-compose/multiple-mounts/multiple_volumes.yaml b/docker-modules/docker-compose/multiple-mounts/multiple_volumes.yaml deleted file mode 100644 index bd722ac5b5..0000000000 --- a/docker-modules/docker-compose/multiple-mounts/multiple_volumes.yaml +++ /dev/null @@ -1,15 +0,0 @@ -services: - my_app: - image: web-app:latest - container_name: web-app - ports: - - "8080:8080" - volumes: - - first-volume-data:/container-path-1 - - second-volume-data:/container-path-2:ro - -volumes: - first-volume-data: - driver: local - second-volume-data: - driver: local \ No newline at end of file diff --git a/docker-modules/docker-compose/pom.xml b/docker-modules/docker-compose/pom.xml deleted file mode 100644 index 90e0226c98..0000000000 --- a/docker-modules/docker-compose/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - 4.0.0 - docker-compose - Demo project for Spring Boot and Docker - - - com.baeldung - parent-boot-3 - 0.0.1-SNAPSHOT - ../../parent-boot-3 - - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - com.baeldung.docker.app.DockAppApplication - - - - - repackage - - - - - - - - \ No newline at end of file diff --git a/docker-modules/docker-compose/rebuild-container/docker-compose-independents.yml b/docker-modules/docker-compose/rebuild-container/docker-compose-independents.yml deleted file mode 100644 index edf0934bc9..0000000000 --- a/docker-modules/docker-compose/rebuild-container/docker-compose-independents.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: "3.9" -services: - ubuntu: - image: "ubuntu:latest" - tty: true - alpine: - image: "alpine:latest" - tty: true \ No newline at end of file diff --git a/docker-modules/docker-compose/rebuild-container/docker-compose-with-dependency.yml b/docker-modules/docker-compose/rebuild-container/docker-compose-with-dependency.yml deleted file mode 100644 index 49852dbd78..0000000000 --- a/docker-modules/docker-compose/rebuild-container/docker-compose-with-dependency.yml +++ /dev/null @@ -1,10 +0,0 @@ -version: "3.9" -services: - ubuntu: - image: "ubuntu:latest" - tty: true - depends_on: - - "alpine" - alpine: - image: "alpine:latest" - tty: true \ No newline at end of file diff --git a/docker-modules/docker-compose/src/main/java/com/baeldung/docker/app/DockAppApplication.java b/docker-modules/docker-compose/src/main/java/com/baeldung/docker/app/DockAppApplication.java deleted file mode 100644 index e7ff52015c..0000000000 --- a/docker-modules/docker-compose/src/main/java/com/baeldung/docker/app/DockAppApplication.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.baeldung.docker.app; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class DockAppApplication { - - public static void main(String[] args) { - SpringApplication.run(DockAppApplication.class, args); - } - -} diff --git a/docker-modules/docker-compose/src/main/java/com/baeldung/docker/app/endpoint/MyController.java b/docker-modules/docker-compose/src/main/java/com/baeldung/docker/app/endpoint/MyController.java deleted file mode 100644 index d46c57e606..0000000000 --- a/docker-modules/docker-compose/src/main/java/com/baeldung/docker/app/endpoint/MyController.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.baeldung.docker.app.endpoint; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class MyController { - - @GetMapping - public String version() { - return "1.7"; - } -} diff --git a/docker-modules/docker-compose/src/main/resources/application.properties b/docker-modules/docker-compose/src/main/resources/application.properties deleted file mode 100644 index 8b13789179..0000000000 --- a/docker-modules/docker-compose/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ - diff --git a/docker-modules/docker-compose/src/test/java/com/baeldung/docker/app/DockAppApplicationUnitTest.java b/docker-modules/docker-compose/src/test/java/com/baeldung/docker/app/DockAppApplicationUnitTest.java deleted file mode 100644 index 7220766988..0000000000 --- a/docker-modules/docker-compose/src/test/java/com/baeldung/docker/app/DockAppApplicationUnitTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.baeldung.docker.app; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class DockAppApplicationUnitTest { - - @Test - void contextLoads() { - } - -} diff --git a/docker-modules/docker-compose/two-compose-share-same-network/create-network-from-service/docker-compose-my-app-service.yaml b/docker-modules/docker-compose/two-compose-share-same-network/create-network-from-service/docker-compose-my-app-service.yaml deleted file mode 100644 index 42e9eec8a1..0000000000 --- a/docker-modules/docker-compose/two-compose-share-same-network/create-network-from-service/docker-compose-my-app-service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -services: - my_app: - image: web-app:latest - container_name: web-app - ports: - - "8080:8080" - networks: - - my-app - -networks: - my-app: - name: redis_network - external: true \ No newline at end of file diff --git a/docker-modules/docker-compose/two-compose-share-same-network/create-network-from-service/docker-compose-redis-service.yaml b/docker-modules/docker-compose/two-compose-share-same-network/create-network-from-service/docker-compose-redis-service.yaml deleted file mode 100644 index ef9573a803..0000000000 --- a/docker-modules/docker-compose/two-compose-share-same-network/create-network-from-service/docker-compose-redis-service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -services: - redis: - image: redis:latest - container_name: redis - ports: - - '6379:6379' - networks: - - network - -networks: - network: - driver: bridge - name: redis_network diff --git a/docker-modules/docker-compose/two-compose-share-same-network/join-existing-network/docker-compose-my-app-service.yaml b/docker-modules/docker-compose/two-compose-share-same-network/join-existing-network/docker-compose-my-app-service.yaml deleted file mode 100644 index f3310108ce..0000000000 --- a/docker-modules/docker-compose/two-compose-share-same-network/join-existing-network/docker-compose-my-app-service.yaml +++ /dev/null @@ -1,12 +0,0 @@ -services: - my_app: - image: web-app:latest - container_name: web-app - ports: - - "8080:8080" - networks: - - network-example - -networks: - network-example: - external: true \ No newline at end of file diff --git a/docker-modules/docker-compose/two-compose-share-same-network/join-existing-network/docker-compose-redis-service.yaml b/docker-modules/docker-compose/two-compose-share-same-network/join-existing-network/docker-compose-redis-service.yaml deleted file mode 100644 index 2cf44a05d6..0000000000 --- a/docker-modules/docker-compose/two-compose-share-same-network/join-existing-network/docker-compose-redis-service.yaml +++ /dev/null @@ -1,12 +0,0 @@ -services: - redis: - image: redis:latest - container_name: redis - ports: - - '6379:6379' - networks: - - network-example - -networks: - network-example: - external: true diff --git a/docker-modules/docker-environment-variables/Dockerfile b/docker-modules/docker-environment-variables/Dockerfile deleted file mode 100644 index dcf69ec2cd..0000000000 --- a/docker-modules/docker-environment-variables/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM alpine:latest - -ARG name -ENV env_name $name - -COPY greetings.sh . - -RUN chmod +x /greetings.sh - -CMD ["/greetings.sh"] \ No newline at end of file diff --git a/docker-modules/docker-environment-variables/README.md b/docker-modules/docker-environment-variables/README.md deleted file mode 100644 index 12da2931a3..0000000000 --- a/docker-modules/docker-environment-variables/README.md +++ /dev/null @@ -1,3 +0,0 @@ - -## Relevant Articles: -- [How to Pass Environment Variable Value into Dockerfile](https://www.baeldung.com/ops/dockerfile-env-variable) diff --git a/docker-modules/docker-environment-variables/greetings.sh b/docker-modules/docker-environment-variables/greetings.sh deleted file mode 100644 index 6b9cd61105..0000000000 --- a/docker-modules/docker-environment-variables/greetings.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -echo Hello $env_name \ No newline at end of file diff --git a/docker-modules/docker-images/.gitignore b/docker-modules/docker-images/.gitignore deleted file mode 100644 index 549e00a2a9..0000000000 --- a/docker-modules/docker-images/.gitignore +++ /dev/null @@ -1,33 +0,0 @@ -HELP.md -target/ -!.mvn/wrapper/maven-wrapper.jar -!**/src/main/**/target/ -!**/src/test/**/target/ - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ -!**/src/main/**/build/ -!**/src/test/**/build/ - -### VS Code ### -.vscode/ diff --git a/docker-modules/docker-images/README.md b/docker-modules/docker-images/README.md deleted file mode 100644 index 9ad9f6a3df..0000000000 --- a/docker-modules/docker-images/README.md +++ /dev/null @@ -1,7 +0,0 @@ -### Relevant Articles: - -- [Pushing a Docker Image to a Private Repository](https://www.baeldung.com/ops/docker-push-image-to-private-repository) -- [How to Include Files Outside of Docker’s Build Context](https://www.baeldung.com/ops/docker-include-files-outside-build-context) -- [Adding a Comment in a Dockerfile](https://www.baeldung.com/ops/docker-dockerfile-comments) -- [Updating PATH Environment Variable in Dockerfile](https://www.baeldung.com/ops/dockerfile-path-environment-variable) -- [Keep Subdirectory Structure in Dockerfile Copy](https://www.baeldung.com/ops/dockerfile-copy-same-subdirectory-structure) diff --git a/docker-modules/docker-images/comments/Dockerfile-add-arguments-to-from b/docker-modules/docker-images/comments/Dockerfile-add-arguments-to-from deleted file mode 100644 index 2de102e20d..0000000000 --- a/docker-modules/docker-images/comments/Dockerfile-add-arguments-to-from +++ /dev/null @@ -1,2 +0,0 @@ -FROM ubuntu:latest # Declare parent image -RUN echo 'This is a Baeldung tutorial' \ No newline at end of file diff --git a/docker-modules/docker-images/comments/Dockerfile-add-arguments-to-run b/docker-modules/docker-images/comments/Dockerfile-add-arguments-to-run deleted file mode 100644 index 186db7683c..0000000000 --- a/docker-modules/docker-images/comments/Dockerfile-add-arguments-to-run +++ /dev/null @@ -1,2 +0,0 @@ -FROM ubuntu:latest -RUN echo 'This is a Baeldung tutorial' # Print sentence \ No newline at end of file diff --git a/docker-modules/docker-images/comments/Dockerfile-base b/docker-modules/docker-images/comments/Dockerfile-base deleted file mode 100644 index a25c52b8da..0000000000 --- a/docker-modules/docker-images/comments/Dockerfile-base +++ /dev/null @@ -1,2 +0,0 @@ -FROM ubuntu:latest -RUN echo 'This is a Baeldung tutorial' \ No newline at end of file diff --git a/docker-modules/docker-images/comments/Dockerfile-multi-line-comments b/docker-modules/docker-images/comments/Dockerfile-multi-line-comments deleted file mode 100644 index 7c1fc43d34..0000000000 --- a/docker-modules/docker-images/comments/Dockerfile-multi-line-comments +++ /dev/null @@ -1,4 +0,0 @@ -# This file is a demonstration -# For a Baeldung article -FROM ubuntu:latest -RUN echo 'This is a Baeldung tutorial' \ No newline at end of file diff --git a/docker-modules/docker-images/comments/Dockerfile-parser-directives b/docker-modules/docker-images/comments/Dockerfile-parser-directives deleted file mode 100644 index e8341b6cec..0000000000 --- a/docker-modules/docker-images/comments/Dockerfile-parser-directives +++ /dev/null @@ -1,4 +0,0 @@ -# escape=` -FROM ubuntu:latest -RUN echo 'This is a Baeldung tutorial&' ` - && echo 'Print more stuff' diff --git a/docker-modules/docker-images/comments/Dockerfile-single-line-comments b/docker-modules/docker-images/comments/Dockerfile-single-line-comments deleted file mode 100644 index a7581769aa..0000000000 --- a/docker-modules/docker-images/comments/Dockerfile-single-line-comments +++ /dev/null @@ -1,4 +0,0 @@ -# Declare parent image -FROM ubuntu:latest -# Print sentence -RUN echo 'This is a Baeldung tutorial' diff --git a/docker-modules/docker-images/files-outside-context/projects/config/Dockerfile b/docker-modules/docker-images/files-outside-context/projects/config/Dockerfile deleted file mode 100644 index 754f9f9be3..0000000000 --- a/docker-modules/docker-images/files-outside-context/projects/config/Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM nginx:latest -COPY nginx.conf /etc/nginx/nginx.conf diff --git a/docker-modules/docker-images/files-outside-context/projects/config/nginx.conf b/docker-modules/docker-images/files-outside-context/projects/config/nginx.conf deleted file mode 100644 index 944da2f112..0000000000 --- a/docker-modules/docker-images/files-outside-context/projects/config/nginx.conf +++ /dev/null @@ -1,8 +0,0 @@ -events {} - -http { - server { - listen 80; - index index.html; - } -} diff --git a/docker-modules/docker-images/files-outside-context/projects/sample-site/docker/Dockerfile b/docker-modules/docker-images/files-outside-context/projects/sample-site/docker/Dockerfile deleted file mode 100644 index bda0bbe257..0000000000 --- a/docker-modules/docker-images/files-outside-context/projects/sample-site/docker/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM nginx:latest -COPY sample-site/html/* /etc/nginx/html/ -COPY config/nginx.conf /etc/nginx/nginx.conf diff --git a/docker-modules/docker-images/files-outside-context/projects/sample-site/docker/Dockerfile-from-base b/docker-modules/docker-images/files-outside-context/projects/sample-site/docker/Dockerfile-from-base deleted file mode 100644 index 1b72414bc0..0000000000 --- a/docker-modules/docker-images/files-outside-context/projects/sample-site/docker/Dockerfile-from-base +++ /dev/null @@ -1,2 +0,0 @@ -FROM sample-site-base:latest -COPY html/* /etc/nginx/html/ diff --git a/docker-modules/docker-images/files-outside-context/projects/sample-site/docker/Dockerfile-script b/docker-modules/docker-images/files-outside-context/projects/sample-site/docker/Dockerfile-script deleted file mode 100644 index 572028f19f..0000000000 --- a/docker-modules/docker-images/files-outside-context/projects/sample-site/docker/Dockerfile-script +++ /dev/null @@ -1,3 +0,0 @@ -FROM nginx:latest -COPY html/* /etc/nginx/html/ -COPY config/nginx.conf /etc/nginx/nginx.conf diff --git a/docker-modules/docker-images/files-outside-context/projects/sample-site/docker/build-docker.sh b/docker-modules/docker-images/files-outside-context/projects/sample-site/docker/build-docker.sh deleted file mode 100644 index e84687b7b7..0000000000 --- a/docker-modules/docker-images/files-outside-context/projects/sample-site/docker/build-docker.sh +++ /dev/null @@ -1,6 +0,0 @@ -mkdir tmp-context -cp -R ../html tmp-context/ -cp -R ../../config tmp-context/ -cp Dockerfile-script tmp-context/Dockerfile -docker build -t sample-site:latest tmp-context -rm -rf tmp-context diff --git a/docker-modules/docker-images/files-outside-context/projects/sample-site/html/index.html b/docker-modules/docker-images/files-outside-context/projects/sample-site/html/index.html deleted file mode 100644 index 85f287fad7..0000000000 --- a/docker-modules/docker-images/files-outside-context/projects/sample-site/html/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Sample Site - - -

Welcome to the first page of the site

- - diff --git a/docker-modules/docker-images/keep-subdirectory-structure-in-Dockerfile-copy/Dockerfile-copy-2folders-atthesametime b/docker-modules/docker-images/keep-subdirectory-structure-in-Dockerfile-copy/Dockerfile-copy-2folders-atthesametime deleted file mode 100644 index 3d6436aaa5..0000000000 --- a/docker-modules/docker-images/keep-subdirectory-structure-in-Dockerfile-copy/Dockerfile-copy-2folders-atthesametime +++ /dev/null @@ -1,3 +0,0 @@ -FROM ubuntu:latest -COPY folder1/ folder2/ /workdir/ -RUN ls --recursive /workdir/ \ No newline at end of file diff --git a/docker-modules/docker-images/keep-subdirectory-structure-in-Dockerfile-copy/Dockerfile-copy-directory b/docker-modules/docker-images/keep-subdirectory-structure-in-Dockerfile-copy/Dockerfile-copy-directory deleted file mode 100644 index 364c82eb5d..0000000000 --- a/docker-modules/docker-images/keep-subdirectory-structure-in-Dockerfile-copy/Dockerfile-copy-directory +++ /dev/null @@ -1,3 +0,0 @@ -FROM ubuntu:latest -COPY folder1/ /workdir/ -RUN ls --recursive /workdir/ \ No newline at end of file diff --git a/docker-modules/docker-images/keep-subdirectory-structure-in-Dockerfile-copy/Dockerfile-merge-directory b/docker-modules/docker-images/keep-subdirectory-structure-in-Dockerfile-copy/Dockerfile-merge-directory deleted file mode 100644 index 16427d90fc..0000000000 --- a/docker-modules/docker-images/keep-subdirectory-structure-in-Dockerfile-copy/Dockerfile-merge-directory +++ /dev/null @@ -1,5 +0,0 @@ -FROM ubuntu:latest -COPY folder1/ /workdir/ -RUN ls --recursive /workdir/ -COPY folder2/ /workdir/ -RUN ls --recursive /workdir/ \ No newline at end of file diff --git a/docker-modules/docker-images/pom.xml b/docker-modules/docker-images/pom.xml deleted file mode 100644 index 4d0b20eea0..0000000000 --- a/docker-modules/docker-images/pom.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - 4.0.0 - docker-images - Example application to showcase Docker images features - - - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 - - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - \ No newline at end of file diff --git a/docker-modules/docker-images/private-repo/Dockerfile b/docker-modules/docker-images/private-repo/Dockerfile deleted file mode 100644 index 42a13e2a93..0000000000 --- a/docker-modules/docker-images/private-repo/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM openjdk:11 -ARG JAR_FILE=target/*.jar -COPY ${JAR_FILE} app.jar -ENTRYPOINT ["java","-jar","/app.jar"] \ No newline at end of file diff --git a/docker-modules/docker-images/src/main/java/com/baeldung/docker/MainApplication.java b/docker-modules/docker-images/src/main/java/com/baeldung/docker/MainApplication.java deleted file mode 100644 index b5e46f3eac..0000000000 --- a/docker-modules/docker-images/src/main/java/com/baeldung/docker/MainApplication.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.baeldung.docker; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class MainApplication { - - public static void main(String[] args) { - SpringApplication.run(MainApplication .class, args); - } - -} diff --git a/docker-modules/docker-images/src/main/java/com/baeldung/docker/controllers/HelloWorldController.java b/docker-modules/docker-images/src/main/java/com/baeldung/docker/controllers/HelloWorldController.java deleted file mode 100644 index f7ade95075..0000000000 --- a/docker-modules/docker-images/src/main/java/com/baeldung/docker/controllers/HelloWorldController.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.baeldung.docker.controllers; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HelloWorldController { - @GetMapping("/helloworld") - String helloWorld() { - return "Hello World!"; - } -} \ No newline at end of file diff --git a/docker-modules/docker-images/src/main/resources/application.properties b/docker-modules/docker-images/src/main/resources/application.properties deleted file mode 100644 index 8b13789179..0000000000 --- a/docker-modules/docker-images/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ - diff --git a/docker-modules/docker-images/update-path/Dockerfile-bashrc b/docker-modules/docker-images/update-path/Dockerfile-bashrc deleted file mode 100644 index 4ac110e16b..0000000000 --- a/docker-modules/docker-images/update-path/Dockerfile-bashrc +++ /dev/null @@ -1,5 +0,0 @@ -FROM ubuntu:latest -RUN echo $PATH -RUN echo "export PATH=$PATH:/etc/profile" >> ~/.bashrc -RUN cat ~/.bashrc -RUN echo $PATH \ No newline at end of file diff --git a/docker-modules/docker-images/update-path/Dockerfile-env b/docker-modules/docker-images/update-path/Dockerfile-env deleted file mode 100644 index 744fba15ed..0000000000 --- a/docker-modules/docker-images/update-path/Dockerfile-env +++ /dev/null @@ -1,4 +0,0 @@ -FROM ubuntu:latest -RUN echo $PATH -ENV PATH="$PATH:/etc/profile" -RUN echo $PATH \ No newline at end of file diff --git a/docker-modules/docker-images/update-path/Dockerfile-run b/docker-modules/docker-images/update-path/Dockerfile-run deleted file mode 100644 index 1e97f66965..0000000000 --- a/docker-modules/docker-images/update-path/Dockerfile-run +++ /dev/null @@ -1,4 +0,0 @@ -FROM ubuntu:latest -RUN echo $PATH -RUN export PATH="$PATH:/etc/profile"; echo $PATH -RUN echo $PATH \ No newline at end of file diff --git a/docker-modules/dockerfile-git-strategies/.gitmodules b/docker-modules/dockerfile-git-strategies/.gitmodules deleted file mode 100644 index aa3911dfc3..0000000000 --- a/docker-modules/dockerfile-git-strategies/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "project"] - path = project - url = https://github.com/eugenp/tutorials.git - branch = master \ No newline at end of file diff --git a/docker-modules/dockerfile-git-strategies/Dockerfile b/docker-modules/dockerfile-git-strategies/Dockerfile deleted file mode 100644 index 98911bdcbd..0000000000 --- a/docker-modules/dockerfile-git-strategies/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -ADD git-strategies /project/ -ADD /build/ /project/ -ADD /output/project.jar /project/ - -ADD ssh-private-key /root/.ssh/id_rsa -RUN git clone git@github.com:eugenp/tutorials.git - -ARG username=$GIT_USERNAME -ARG password=$GIT_PASSWORD -RUN git clone https://username:password@github.com:eugenp/tutorials.git - -VOLUME /build/ /project/ - diff --git a/docker-modules/dockerfile-git-strategies/README.md b/docker-modules/dockerfile-git-strategies/README.md deleted file mode 100644 index 7e27328678..0000000000 --- a/docker-modules/dockerfile-git-strategies/README.md +++ /dev/null @@ -1,3 +0,0 @@ -## Relevant Articles: - -- [Dockerfile Strategies for Git](https://www.baeldung.com/ops/dockerfile-git-strategies) diff --git a/docker-modules/kaniko/README.md b/docker-modules/kaniko/README.md deleted file mode 100644 index a69a3cb683..0000000000 --- a/docker-modules/kaniko/README.md +++ /dev/null @@ -1,3 +0,0 @@ -### Relevant Articles: - -- [An Introduction to Kaniko](https://www.baeldung.com/ops/kaniko) diff --git a/docker-modules/kaniko/dockerfile b/docker-modules/kaniko/dockerfile deleted file mode 100644 index 0290bf16ed..0000000000 --- a/docker-modules/kaniko/dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM ubuntu -ENTRYPOINT ["/bin/bash", "-c", "echo hello"] diff --git a/docker-modules/kaniko/pod.yaml b/docker-modules/kaniko/pod.yaml deleted file mode 100644 index 17f9a81b6d..0000000000 --- a/docker-modules/kaniko/pod.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: kaniko -spec: - containers: - - name: kaniko - image: gcr.io/kaniko-project/executor:latest - args: ["--dockerfile=/workspace/dockerfile", - "--context=dir://workspace", - "--no-push"] - volumeMounts: - - name: dockerfile-storage - mountPath: /workspace - restartPolicy: Never - volumes: - - name: dockerfile-storage - persistentVolumeClaim: - claimName: dockerfile-claim diff --git a/docker-modules/kaniko/volume-claim.yaml b/docker-modules/kaniko/volume-claim.yaml deleted file mode 100644 index 7a1abbf05c..0000000000 --- a/docker-modules/kaniko/volume-claim.yaml +++ /dev/null @@ -1,11 +0,0 @@ -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: dockerfile-claim -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 8Gi - storageClassName: local-storage diff --git a/docker-modules/kaniko/volume.yaml b/docker-modules/kaniko/volume.yaml deleted file mode 100644 index e44663ec5a..0000000000 --- a/docker-modules/kaniko/volume.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: dockerfile - labels: - type: local -spec: - capacity: - storage: 10Gi - accessModes: - - ReadWriteOnce - storageClassName: local-storage - hostPath: - path: /home/docker/kaniko # Path to the local mount directory that was setup diff --git a/docker-modules/pom.xml b/docker-modules/pom.xml index bf35ef23ab..422b65023c 100644 --- a/docker-modules/pom.xml +++ b/docker-modules/pom.xml @@ -14,16 +14,11 @@ - docker-caching - docker-compose - docker-compose-2 docker-containers - docker-images docker-spring-boot docker-spring-boot-postgres docker-java-jar jib - \ No newline at end of file