Skip to content

Commit 4ef8013

Browse files
committed
Add shell script to build config, eureka, sba images, bump boot, eureka, sba deps
- also convert all .adoc to .md
1 parent b5407a0 commit 4ef8013

File tree

19 files changed

+248
-185
lines changed

19 files changed

+248
-185
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ build/
1010

1111
# MacOS
1212
.DS_Store
13+
14+
# native build artifacts
15+
*.zip
16+
*-temp/

README.adoc

Lines changed: 0 additions & 55 deletions
This file was deleted.

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# SteeltoeOSS Docker Images
2+
3+
GitHub repo for server images to use for local development with SteeltoeOSS.
4+
5+
## Building
6+
7+
### Build a specific image
8+
9+
```shell
10+
./build.ps1 config-server
11+
```
12+
13+
## Running
14+
15+
### List the created images
16+
17+
```shell
18+
docker images
19+
```
20+
21+
See [Common Tasks](https://github.com/SteeltoeOSS/Samples/blob/main/CommonTasks.md/) for instructions on how to run the various docker images.
22+
23+
## Images
24+
25+
| Name | Description |
26+
| ---- | ----------- |
27+
| [steeltoe.azurecr.io/config-server](config-server/) | Spring Cloud Config Server |
28+
| [steeltoe.azurecr.io/eureka-server](eureka-server/) | Netflix Eureka Server |
29+
| [steeltoe.azurecr.io/spring-boot-admin](spring-boot-admin/) | Spring Boot Admin |
30+
| [steeltoe.azurecr.io/uaa-server](uaa-server/) | CloudFoundry UAA Server |
31+
32+
## Debug Image Building
33+
34+
### Inspect Container Contents
35+
36+
Via [StackOverflow](https://stackoverflow.com/questions/32353055/how-to-start-a-stopped-docker-container-with-a-different-command/39329138#39329138), here are the commands to list files in a stopped container.
37+
38+
1. Find the id of the stopped container
39+
* `docker ps -a`
40+
1. Commit the stopped container to a new image: test_image.
41+
* `docker commit $CONTAINER_ID test_image`
42+
1. Run the new image in a new container with a shell.
43+
* `docker run -ti --entrypoint=sh test_image`

config-server/Dockerfile

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,27 @@
22
# Spring Config Server Build
33
# -----------------------------------------------------------------------------
44
ARG JVM=21
5+
ARG BOOT_VERSION=3.5.6
6+
# When changing, make sure this aligns with metadata/IMAGE_VERSION
7+
ARG SERVER_VERSION=4.3.0
58

69
FROM eclipse-temurin:$JVM-alpine AS build
710
ARG JVM
11+
ARG BOOT_VERSION
12+
ARG SERVER_VERSION
813
WORKDIR /scratch
914
RUN apk update && apk add ca-certificates && apk add curl && apk add patch
1015
RUN curl --get https://start.spring.io/starter.zip \
11-
-d type=gradle-project \
12-
-d bootVersion=3.5.4 \
13-
-d javaVersion=$JVM \
14-
-d groupId=io.steeltoe.docker \
15-
-d artifactId=configserver \
16-
-d applicationName=ConfigServer \
17-
-d language=java \
18-
-d dependencies=cloud-config-server,actuator,cloud-eureka,security \
19-
-d version=4.3.0 \
20-
--output configserver.zip
16+
-d type=gradle-project \
17+
-d bootVersion=$BOOT_VERSION \
18+
-d javaVersion=$JVM \
19+
-d groupId=io.steeltoe.docker \
20+
-d artifactId=configserver \
21+
-d applicationName=ConfigServer \
22+
-d language=java \
23+
-d dependencies=cloud-config-server,actuator,cloud-eureka,security \
24+
-d version=$SERVER_VERSION \
25+
--output configserver.zip
2126
RUN mkdir configserver && unzip -d configserver configserver.zip
2227
COPY metadata metadata
2328
COPY patches patches
@@ -35,7 +40,6 @@ RUN mkdir output && \
3540
# -----------------------------------------------------------------------------
3641
# Spring Config Server Linux Image
3742
# -----------------------------------------------------------------------------
38-
3943
FROM eclipse-temurin:$JVM-alpine
4044
WORKDIR /config-server
4145
COPY --from=build /scratch/output .

config-server/README.adoc

Lines changed: 0 additions & 53 deletions
This file was deleted.

config-server/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# steeltoe.azurecr.io/config-server
2+
3+
Image for SteeltoeOSS local development with [Spring Cloud Config Server](https://docs.spring.io/spring-cloud-config/docs/current/reference/html/).
4+
5+
## Running
6+
7+
Default configuration:
8+
9+
```shell
10+
docker run --publish 8888:8888 steeltoe.azurecr.io/config-server
11+
```
12+
13+
Custom git repo configuration:
14+
15+
```shell
16+
docker run --publish 8888:8888 steeltoe.azurecr.io/config-server \
17+
--spring.cloud.config.server.git.uri=https://github.com/myorg/myrepo.git
18+
```
19+
20+
Local file system configuration:
21+
22+
```shell
23+
docker run --publish 8888:8888 --volume /path/to/my/config:/config steeltoe.azurecr.io/config-server \
24+
--spring.profiles.active=native \
25+
--spring.cloud.config.server.native.searchLocations=file:///config
26+
```
27+
28+
With basic auth:
29+
30+
```shell
31+
docker run --publish 8888:8888 steeltoe.azurecr.io/config-server \
32+
--auth.enabled=true \
33+
--auth.username=myCustomUser \
34+
--auth.password=myCustomPassword
35+
```
36+
37+
## Resources
38+
39+
| Path | Description |
40+
| ---- | ----------- |
41+
| /_{app}_/_{profile}_ | Configuration data for app in Spring profile |
42+
| /_{app}_/_{profile}_/_{label}_ | Add a git label |
43+
| /_{app}_/_{profiles}/{label}_/_{path}_ | Environment-specific plain text config file at _{path}_|
44+
45+
_Example:_ <http://localhost:8888/foo/bar>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1

eureka-server/Dockerfile

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,27 @@
22
# Netflix Eureka Server Build
33
# -----------------------------------------------------------------------------
44
ARG JVM=21
5+
ARG BOOT_VERSION=3.5.6
6+
# When changing, make sure this aligns with metadata/IMAGE_VERSION
7+
ARG SERVER_VERSION=4.3.0
58

69
FROM eclipse-temurin:$JVM-alpine AS build
710
ARG JVM
11+
ARG BOOT_VERSION
12+
ARG SERVER_VERSION
813
WORKDIR /scratch
914
RUN apk update && apk add ca-certificates && apk add curl && apk add patch
1015
RUN curl --get https://start.spring.io/starter.zip \
11-
-d type=gradle-project \
12-
-d bootVersion=3.4.1 \
13-
-d javaVersion=$JVM \
14-
-d groupId=io.steeltoe.docker \
15-
-d artifactId=eurekaserver \
16-
-d applicationName=EurekaServer \
17-
-d language=java \
18-
-d dependencies=cloud-eureka-server,actuator \
19-
-d version=4.2.0 \
20-
--output eurekaserver.zip
16+
-d type=gradle-project \
17+
-d bootVersion=$BOOT_VERSION \
18+
-d javaVersion=$JVM \
19+
-d groupId=io.steeltoe.docker \
20+
-d artifactId=eurekaserver \
21+
-d applicationName=EurekaServer \
22+
-d language=java \
23+
-d dependencies=cloud-eureka-server,actuator \
24+
-d version=$SERVER_VERSION \
25+
--output eurekaserver.zip
2126
RUN mkdir eurekaserver && unzip -d eurekaserver eurekaserver.zip
2227
COPY metadata metadata
2328
COPY patches patches
@@ -34,7 +39,6 @@ RUN mkdir output && \
3439
# -----------------------------------------------------------------------------
3540
# Netflix Eureka Server Linux Image
3641
# -----------------------------------------------------------------------------
37-
3842
FROM eclipse-temurin:$JVM-alpine
3943
WORKDIR /eureka-server
4044
COPY --from=build /scratch/output .

eureka-server/README.adoc

Lines changed: 0 additions & 26 deletions
This file was deleted.

eureka-server/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# steeltoe.azurecr.io/eureka-server
2+
3+
Image for SteeltoeOSS local development with [Spring Cloud Eureka Server](https://cloud.spring.io/spring-cloud-netflix/reference/html).
4+
5+
## Running
6+
7+
```shell
8+
docker run --rm -it --pull=always -p 8761:8761 --name steeltoe-eureka steeltoe.azurecr.io/eureka-server
9+
```
10+
11+
## Resources
12+
13+
| Path | Description |
14+
| ---- | ----------- |
15+
| / | Service registration listing |
16+
| /eureka/apps | Registration metadata |
17+
| /actuator/health | Health check |

0 commit comments

Comments
 (0)