Skip to content

Commit 23e73d4

Browse files
cheeminglijoostmeijles
authored andcommitted
Fix Redis image not being pushed (#156)
* Fix Redis image not being pushed Move Redis target to base build and add to list of names so the image is build/pushed. * Introduce REPOSITORY environment variable New REPOSITORY environment variable added to example docker-compose files. Can be used to configure the Docker repository. README updated with Redis information and the new REPOSITORY variable.
1 parent 89c645a commit 23e73d4

9 files changed

+46
-43
lines changed

README.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ The build results in the following Docker images:
4343
- `sitecore-base-sitecore`: IIS + ASP.NET
4444
- `sitecore-base-openjdk`: Windows Server Core + OpenJDK
4545
- `sitecore-base-solr-builder`: sitecore-base-openjdk + Solr
46+
- `sitecore-base-redis`: Windows Server Core + OpenJDK
4647

4748
- XP0
4849
- `sitecore-xp-sitecore`: IIS + ASP.NET + Sitecore
@@ -134,12 +135,13 @@ PS> docker-compose -f docker-compose.yml -f docker-compose.jss.yml up
134135

135136
Run-time parameters can be modified using the `.env` file:
136137

137-
| Field | Description |
138-
| ------------------------- | ------------------------------------------------ |
139-
| SQL_SA_PASSWORD | The password to use for the SQL sa user |
140-
| SITECORE_SITE_NAME | Host name of the Sitecore site |
141-
| IMAGE_PREFIX | The Docker image prefix to use |
142-
| TAG | The version to tag the Docker images with |
138+
| Field | Description |
139+
| ------------------------- | --------------------------------------------------------- |
140+
| SQL_SA_PASSWORD | The password to use for the SQL sa user |
141+
| SITECORE_SITE_NAME | Host name of the Sitecore site |
142+
| REPOSITORY | The Docker repository to use (must include ending slash ) |
143+
| IMAGE_PREFIX | The Docker image prefix to use |
144+
| TAG | The version to tag the Docker images with |
143145

144146
NB. these run-time parameters should match the used build parameters.
145147

build/Build.Base.cs

+12-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ partial class Build : NukeBuild
2222
{
2323
"openjdk",
2424
"sitecore",
25-
"solr-builder"
25+
"solr-builder",
26+
"redis"
2627
};
2728

2829
private string BaseFullImageName(string name) => string.IsNullOrEmpty(BuildVersion) ?
@@ -69,6 +70,16 @@ private string BaseFullImageName(string name) => string.IsNullOrEmpty(BuildVersi
6970
);
7071
});
7172

73+
Target BaseRedis => _ => _
74+
.Executes(() =>
75+
{
76+
DockerBuild(x => x
77+
.SetPath(".")
78+
.SetFile("base/redis/Dockerfile")
79+
.SetTag(BaseImageName("redis"))
80+
);
81+
});
82+
7283
Target Base => _ => _
7384
.DependsOn(BaseOpenJdk, BaseSitecore);
7485

build/Build.Xc.cs

+1-11
Original file line numberDiff line numberDiff line change
@@ -404,17 +404,7 @@ private string XcFullImageName(string name) => string.IsNullOrEmpty(BuildVersion
404404
});
405405

406406
Target Xc => _ => _
407-
.DependsOn(XcCommerce, XcSitecore, XcMssql, XcSolr, XcXconnect, XcIdentity, XcRedis);
408-
409-
Target XcRedis => _ => _
410-
.Executes(() =>
411-
{
412-
DockerBuild(x => x
413-
.SetPath(".")
414-
.SetFile("base/redis/Dockerfile")
415-
.SetTag(XcImageName("redis"))
416-
);
417-
});
407+
.DependsOn(XcCommerce, XcSitecore, XcMssql, XcSolr, XcXconnect, XcIdentity, BaseRedis);
418408

419409
Target XcSxa => _ => _
420410
.DependsOn(Xc, XcSitecoreMssqlSxa, XcSolrSxa);

example/xc/docker-compose.jss.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ version: '2.4'
33

44
services:
55
commerce:
6-
image: "${IMAGE_PREFIX}commerce:${TAG}"
6+
image: "${REPOSITORY}${IMAGE_PREFIX}commerce:${TAG}"
77

88
mssql:
9-
image: "${IMAGE_PREFIX}mssql-jss:${TAG}"
9+
image: "${REPOSITORY}${IMAGE_PREFIX}mssql-jss:${TAG}"
1010

1111
sitecore:
12-
image: "${IMAGE_PREFIX}sitecore-jss:${TAG}"
12+
image: "${REPOSITORY}${IMAGE_PREFIX}sitecore-jss:${TAG}"

example/xc/docker-compose.sxa.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ version: '2.4'
33

44
services:
55
commerce:
6-
image: "${IMAGE_PREFIX}commerce:${TAG}"
6+
image: "${REPOSITORY}${IMAGE_PREFIX}commerce:${TAG}"
77

88
mssql:
9-
image: "${IMAGE_PREFIX}mssql-sxa:${TAG}"
9+
image: "${REPOSITORY}${IMAGE_PREFIX}mssql-sxa:${TAG}"
1010

1111
sitecore:
12-
image: "${IMAGE_PREFIX}sitecore-sxa:${TAG}"
12+
image: "${REPOSITORY}${IMAGE_PREFIX}sitecore-sxa:${TAG}"
1313

1414
solr:
15-
image: "${IMAGE_PREFIX}solr-sxa:${TAG}"
15+
image: "${REPOSITORY}${IMAGE_PREFIX}solr-sxa:${TAG}"
1616

1717
xconnect:
18-
image: "${IMAGE_PREFIX}xconnect:${TAG}"
18+
image: "${REPOSITORY}${IMAGE_PREFIX}xconnect:${TAG}"

example/xc/docker-compose.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: '2.4'
33
services:
44

55
identity:
6-
image: "${IMAGE_PREFIX}identity:${TAG}"
6+
image: "${REPOSITORY}${IMAGE_PREFIX}identity:${TAG}"
77
command: -commerceHostname ${COMMERCE_HOST_NAME} -sitecoreHostname ${SITECORE_HOST_NAME} -identityHostname ${IDENTITY_HOST_NAME}
88
isolation: process
99
networks:
@@ -17,7 +17,7 @@ services:
1717
- mssql
1818

1919
commerce:
20-
image: "${IMAGE_PREFIX}commerce:${TAG}"
20+
image: "${REPOSITORY}${IMAGE_PREFIX}commerce:${TAG}"
2121
isolation: process
2222
command: -commerceHostname ${COMMERCE_HOST_NAME} -sitecoreHostname ${SITECORE_HOST_NAME} -identityHostname ${IDENTITY_HOST_NAME}
2323
networks:
@@ -40,7 +40,7 @@ services:
4040
- redis
4141

4242
mssql:
43-
image: "${IMAGE_PREFIX}mssql:${TAG}"
43+
image: "${REPOSITORY}${IMAGE_PREFIX}mssql:${TAG}"
4444
isolation: process
4545
networks:
4646
- exampleNetwork
@@ -51,7 +51,7 @@ services:
5151
- .\data\mssql:C:\Data
5252

5353
sitecore:
54-
image: "${IMAGE_PREFIX}sitecore:${TAG}"
54+
image: "${REPOSITORY}${IMAGE_PREFIX}sitecore:${TAG}"
5555
command: -commerceHostname ${COMMERCE_HOST_NAME} -identityHostname ${IDENTITY_HOST_NAME}
5656
isolation: process
5757
networks:
@@ -69,15 +69,15 @@ services:
6969
- identity
7070

7171
solr:
72-
image: "${IMAGE_PREFIX}solr:${TAG}"
72+
image: "${REPOSITORY}${IMAGE_PREFIX}solr:${TAG}"
7373
isolation: process
7474
networks:
7575
- exampleNetwork
7676
volumes:
7777
- .\data\solr:C:\Data
7878

7979
xconnect:
80-
image: "${IMAGE_PREFIX}xconnect:${TAG}"
80+
image: "${REPOSITORY}${IMAGE_PREFIX}xconnect:${TAG}"
8181
isolation: process
8282
networks:
8383
- exampleNetwork
@@ -89,7 +89,7 @@ services:
8989
- solr
9090

9191
redis:
92-
image: "${IMAGE_PREFIX}redis:${TAG}"
92+
image: "${REPOSITORY}sitecore-base-redis:${TAG}"
9393
isolation: process
9494
networks:
9595
- exampleNetwork

example/xp/docker-compose.jss.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: '2.4'
33

44
services:
55
mssql:
6-
image: "${IMAGE_PREFIX}mssql-jss:${TAG}"
6+
image: "${REPOSITORY}${IMAGE_PREFIX}mssql-jss:${TAG}"
77

88
sitecore:
9-
image: "${IMAGE_PREFIX}sitecore-jss:${TAG}"
9+
image: "${REPOSITORY}${IMAGE_PREFIX}sitecore-jss:${TAG}"

example/xp/docker-compose.sxa.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ version: '2.4'
33

44
services:
55
mssql:
6-
image: "${IMAGE_PREFIX}mssql-sxa:${TAG}"
6+
image: "${REPOSITORY}${IMAGE_PREFIX}mssql-sxa:${TAG}"
77

88
sitecore:
9-
image: "${IMAGE_PREFIX}sitecore-sxa:${TAG}"
9+
image: "${REPOSITORY}${IMAGE_PREFIX}sitecore-sxa:${TAG}"
1010

1111
solr:
12-
image: "${IMAGE_PREFIX}solr-sxa:${TAG}"
12+
image: "${REPOSITORY}${IMAGE_PREFIX}solr-sxa:${TAG}"

example/xp/docker-compose.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: '2.4'
33
services:
44

55
identity:
6-
image: "${IMAGE_PREFIX}identity:${TAG}"
6+
image: "${REPOSITORY}${IMAGE_PREFIX}identity:${TAG}"
77
command: -sitecoreHostname ${SITECORE_HOST_NAME} -identityHostname ${IDENTITY_HOST_NAME}
88
networks:
99
- exampleNetwork
@@ -14,7 +14,7 @@ services:
1414
- mssql
1515

1616
mssql:
17-
image: "${IMAGE_PREFIX}mssql:${TAG}"
17+
image: "${REPOSITORY}${IMAGE_PREFIX}mssql:${TAG}"
1818
networks:
1919
- exampleNetwork
2020
environment:
@@ -24,7 +24,7 @@ services:
2424
- .\data\mssql:C:\Data
2525

2626
sitecore:
27-
image: "${IMAGE_PREFIX}sitecore:${TAG}"
27+
image: "${REPOSITORY}${IMAGE_PREFIX}sitecore:${TAG}"
2828
networks:
2929
- exampleNetwork
3030
volumes:
@@ -38,14 +38,14 @@ services:
3838
- identity
3939

4040
solr:
41-
image: "${IMAGE_PREFIX}solr:${TAG}"
41+
image: "${REPOSITORY}${IMAGE_PREFIX}solr:${TAG}"
4242
networks:
4343
- exampleNetwork
4444
volumes:
4545
- .\data\solr:C:\Data
4646

4747
xconnect:
48-
image: "${IMAGE_PREFIX}xconnect:${TAG}"
48+
image: "${REPOSITORY}${IMAGE_PREFIX}xconnect:${TAG}"
4949
networks:
5050
- exampleNetwork
5151
volumes:

0 commit comments

Comments
 (0)