-
Notifications
You must be signed in to change notification settings - Fork 48
Resolve docker build issues #3691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
395c70b
Tag all created docker images with `dev` tag so these can be easily t…
ramonsmits f08cb64
Ignoring generated docker files
ramonsmits c9d4235
🐛 docker build was using git ROOT folder, causing all files to be pus…
ramonsmits 3fb11b7
✨ Docker compose sample with init containers
ramonsmits be0cf1a
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore…
ramonsmits 507e611
Circumvent reposync
ramonsmits cc945b3
Fix EOF
ramonsmits 253840f
Docker compose for RabbitMQ
ramonsmits 60b18e2
Moved docker compose for servicecontrol instance to subfolder
ramonsmits 8063f7d
Moved folder from sample to docker-sample
ramonsmits aa71e62
Removed comments from docker compose files and
ramonsmits 21b3045
Made script not rely on C:\
ramonsmits deaaee0
Removed IP's that should not be in there :-)
ramonsmits 22691a8
Update Docker images directory readme
DavidBoike 19c17ed
Apply suggestions from code review
ramonsmits a80c233
Generating docker files to project output path and picking artifacts …
ramonsmits 46fd429
Optimize preparing by only copying content of transport folder once t…
ramonsmits c2014f7
Improved the names of the item groups
ramonsmits 928b5c3
Delete deploy/.dockerignore
ramonsmits 1cc64cf
README for the docker sampe to test the (rabbitmq) images
ramonsmits 287cf57
Apply suggestions from code review
ramonsmits 37221f7
Update src/ServiceControl.DockerImages/ServiceControl.DockerImages.cs…
ramonsmits 67263e0
Extracted building docker folder into a new `PrepareDockerBuildConten…
ramonsmits 0ca696b
⚜️Added comment explaining why the propertygroup cannot be underneath…
ramonsmits 0a59b67
🔨 Moved declaration of `DockerfilesFolder` to `CleanGeneratedDockerfi…
ramonsmits 395cf83
Revert "Generating docker files to project output path and picking ar…
ramonsmits 908b068
whitespace
ramonsmits e1e9718
Build docker images during CI (for now to measure the duration)
ramonsmits 92d98d5
Revert building docker images as we don't have any supported docker i…
ramonsmits 66d6eff
Refned README
ramonsmits File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,4 @@ | ||
| # Dockerfiles dynamically created here by templates | ||
| # Can't be in RepoStandards gitignore because other repos may need source-controlled static dockerfiles | ||
| *.dockerfile | ||
|
|
||
This file contains hidden or 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,19 @@ | ||
| # ServiceControl on Docker | ||
|
|
||
| The sample allows to (partially) test the SC docker images locally. | ||
|
|
||
| ## Issues | ||
|
|
||
| ### host.docker.internal not working | ||
|
|
||
| The `.env` file contains a `CONNECTIONSTRING` item with the value `host.docker.internal`. This value does not seem to work that needs to be set to the IP address of the host. the | ||
|
|
||
| ### Host cannot be accessed | ||
|
|
||
| Disable the Windows Firewall if the Windows container cannot access the Linux container | ||
|
|
||
| ## Setup | ||
|
|
||
| 1. Run the `setup.bat` scripts `rabbitmq` folder to setup a local rabbitmq Linux container | ||
| 1. Run the `setup.bat` scripts `servicecontrol` folder to setup a servicecontrol primary, audit and monitoring instance in 3 Windows container using the RabbitMQ transport | ||
|
|
This file contains hidden or 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,17 @@ | ||
| version: '3' | ||
|
|
||
| services: | ||
|
|
||
| rabbitmq: | ||
| image: rabbitmq:3-management | ||
| platform: linux | ||
| hostname: rabbitmq | ||
| ports: | ||
| - 5672:5672 | ||
| - 15672:15672 | ||
| volumes: | ||
| - rabbitmq-data:/var/lib/rabbitmq/mnesia | ||
| - ./enabled_plugins:/etc/rabbitmq/enabled_plugins | ||
|
|
||
| volumes: | ||
| rabbitmq-data: |
This file contains hidden or 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 @@ | ||
| [rabbitmq_federation_management,rabbitmq_management,rabbitmq_mqtt,rabbitmq_stomp,rabbitmq_shovel,rabbitmq_shovel_management]. |
This file contains hidden or 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,2 @@ | ||
| "%ProgramFiles%\Docker\Docker\DockerCli.exe" -SwitchLinuxEngine | ||
| docker compose up -d |
This file contains hidden or 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,10 @@ | ||
| ServiceControl_DatabaseMaintenancePort = 44444 | ||
| ServiceControl_RemoteInstances = [{'api_uri':'http://scaudit:44444/api'}] | ||
| ServiceControl_Audit_ServiceControlQueueAddress = Particular.ServiceControl | ||
|
|
||
| # Often host.docker.internal does not work on Windows containers. Replace with the actual IP of the docker host and also check firewall | ||
| CONNECTIONSTRING=host=host.docker.internal | ||
|
|
||
| ServiceControl_ConnectionString=%CONNECTIONSTRING% | ||
| ServiceControl_Audit_ConnectionString=%CONNECTIONSTRING% | ||
| Monitoring_ConnectionString=%CONNECTIONSTRING% |
This file contains hidden or 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,80 @@ | ||
| version: '3.8' | ||
|
|
||
| services: | ||
|
|
||
| primary-init: | ||
| image: particular/servicecontrol.rabbitmq.quorum.conventional.init-windows:dev | ||
| platform: windows | ||
| hostname: scprimary | ||
| ports: | ||
| - 33333:33333 | ||
| volumes: | ||
| - primary-db:c:/data/ | ||
| - c:/ProgramData/ParticularSoftware/:c:/ProgramData/ParticularSoftware/:ro | ||
| env_file: .env | ||
|
|
||
| audit-init: | ||
| image: particular/servicecontrol.rabbitmq.quorum.conventional.audit.init-windows:dev | ||
| platform: windows | ||
| hostname: scaudit | ||
| ports: | ||
| - 44444:44444 | ||
| volumes: | ||
| - audit-db:c:/data/ | ||
| - c:/ProgramData/ParticularSoftware/:c:/ProgramData/ParticularSoftware/:ro | ||
| env_file: .env | ||
|
|
||
| monitoring-init: | ||
| image: particular/servicecontrol.rabbitmq.quorum.conventional.monitoring.init-windows:dev | ||
| platform: windows | ||
| hostname: scmonitoring | ||
| ports: | ||
| - 33633:33633 | ||
| volumes: | ||
| - c:/ProgramData/ParticularSoftware/:c:/ProgramData/ParticularSoftware/:ro | ||
| env_file: .env | ||
|
|
||
| primary: | ||
| depends_on: | ||
| primary-init: | ||
| condition: service_completed_successfully | ||
| image: particular/servicecontrol.rabbitmq.quorum.conventional-windows:dev | ||
| platform: windows | ||
| hostname: scprimary | ||
| ports: | ||
| - 33333:33333 | ||
| volumes: | ||
| - primary-db:c:/data/ | ||
| - c:/ProgramData/ParticularSoftware/:c:/ProgramData/ParticularSoftware/:ro | ||
| env_file: .env | ||
|
|
||
| audit: | ||
| depends_on: | ||
| audit-init: | ||
| condition: service_completed_successfully | ||
| image: particular/servicecontrol.rabbitmq.quorum.conventional.audit-windows:dev | ||
| platform: windows | ||
| hostname: scaudit | ||
| ports: | ||
| - 44444:44444 | ||
| volumes: | ||
| - audit-db:c:/data/ | ||
| - c:/ProgramData/ParticularSoftware/:c:/ProgramData/ParticularSoftware/:ro | ||
| env_file: .env | ||
|
|
||
| monitoring: | ||
| depends_on: | ||
| monitoring-init: | ||
| condition: service_completed_successfully | ||
| image: particular/servicecontrol.rabbitmq.quorum.conventional.monitoring-windows:dev | ||
| platform: windows | ||
| hostname: scmon | ||
| ports: | ||
| - 33633:33633 | ||
| volumes: | ||
| - c:/ProgramData/ParticularSoftware/:c:/ProgramData/ParticularSoftware/:ro | ||
| env_file: .env | ||
|
|
||
| volumes: | ||
| primary-db: | ||
| audit-db: |
This file contains hidden or 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,2 @@ | ||
| "%ProgramFiles%\Docker\Docker\DockerCli.exe" -SwitchWindowsEngine | ||
| docker compose up -d |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,8 +1,9 @@ | ||
| # ServiceControl.DockerImages | ||
|
|
||
|
|
||
| WARNING | ||
|
|
||
| This project is not automatically built when building the solution | ||
| to keep the overall build time under control. | ||
| To build Docker images explicitly build this project. | ||
| # ServiceControl.DockerImages | ||
|
|
||
| WARNING: This project is not automatically built when building the solution to keep the overall build time under control. | ||
|
|
||
| To build Docker images explicitly build this project. | ||
|
|
||
| ## Notes | ||
|
|
||
| * Each `ADD`, `ENV` or `EXPOSE` statement creates an additional layer in the Docker container, so these statements should be combined into one and not split out. |
This file contains hidden or 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
29 changes: 12 additions & 17 deletions
29
src/ServiceControl.DockerImages/servicecontrol.transport-windows.dockerfile-template
This file contains hidden or 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 |
|---|---|---|
| @@ -1,29 +1,24 @@ | ||
| FROM mcr.microsoft.com/dotnet/framework/runtime:4.7.2-windowsservercore-ltsc2016 | ||
| FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2022 | ||
|
|
||
| WORKDIR /servicecontrol | ||
|
|
||
| ARG TRANSPORT | ||
| ADD /deploy/Particular.ServiceControl/ServiceControl . | ||
| ADD /deploy/Particular.ServiceControl/Transports/${TRANSPORT} . | ||
| ADD /deploy/Particular.ServiceControl/Persisters/RavenDB35 . | ||
|
|
||
| ENV "SERVICECONTROL_RUNNING_IN_DOCKER"="true" | ||
| ADD /Particular.ServiceControl/ServiceControl /Transports/${TRANSPORT} /Particular.ServiceControl/Persisters/RavenDB35 ./ | ||
|
|
||
| ARG TRANSPORT_CUSTOMIZATION_TYPE | ||
| ENV "ServiceControl/TransportType"="${TRANSPORT_CUSTOMIZATION_TYPE}" | ||
| ENV "ServiceControl/PersistenceType"="ServiceControl.Persistence.RavenDb.RavenDbPersistenceConfiguration, ServiceControl.Persistence.RavenDb" | ||
| ENV "ServiceControl/Hostname"="*" | ||
|
|
||
| ENV "ServiceControl/DBPath"="C:\\Data\\DB\\" | ||
| ENV "ServiceControl/LogPath"="C:\\Data\\Logs\\" | ||
|
|
||
| # Defaults | ||
| ENV "ServiceControl/ForwardErrorMessages"="False" | ||
| ENV "ServiceControl/ErrorRetentionPeriod"="15" | ||
|
|
||
| EXPOSE 33333 | ||
| EXPOSE 33334 | ||
| ENV "ServiceControl/TransportType"="${TRANSPORT_CUSTOMIZATION_TYPE}" \ | ||
| "ServiceControl/PersistenceType"="ServiceControl.Persistence.RavenDb.RavenDbPersistenceConfiguration, ServiceControl.Persistence.RavenDb" \ | ||
| "ServiceControl/Hostname"="*" \ | ||
| "ServiceControl/DBPath"="C:\\Data\\DB\\" \ | ||
| "ServiceControl/LogPath"="C:\\Data\\Logs\\" \ | ||
| "ServiceControl/ForwardErrorMessages"="False" \ | ||
| "ServiceControl/ErrorRetentionPeriod"="15" \ | ||
| "SERVICECONTROL_RUNNING_IN_DOCKER"="true" | ||
|
|
||
| VOLUME [ "C:/Data" ] | ||
|
|
||
| EXPOSE 33333 33334 | ||
|
|
||
| ENTRYPOINT ["ServiceControl.exe", "--portable"] |
31 changes: 13 additions & 18 deletions
31
src/ServiceControl.DockerImages/servicecontrol.transport.audit-windows.dockerfile-template
This file contains hidden or 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 |
|---|---|---|
| @@ -1,30 +1,25 @@ | ||
| FROM mcr.microsoft.com/dotnet/framework/runtime:4.7.2-windowsservercore-ltsc2016 | ||
| FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2022 | ||
|
|
||
| WORKDIR /servicecontrol.audit | ||
|
|
||
| ARG TRANSPORT | ||
| ADD /deploy/Particular.ServiceControl.Audit/ServiceControl.Audit . | ||
| ADD /deploy/Particular.ServiceControl.Audit/Transports/${TRANSPORT} . | ||
| ADD /deploy/Particular.ServiceControl.Audit/Persisters/RavenDB35 . | ||
|
|
||
| ENV "SERVICECONTROL_RUNNING_IN_DOCKER"="true" | ||
| ADD /Particular.ServiceControl.Audit/ServiceControl.Audit /Transports/${TRANSPORT} /Particular.ServiceControl.Audit/Persisters/RavenDB35 ./ | ||
|
|
||
| ARG TRANSPORT_CUSTOMIZATION_TYPE | ||
| ENV "ServiceControl.Audit/TransportType"="${TRANSPORT_CUSTOMIZATION_TYPE}" | ||
| ENV "ServiceControl.Audit/PersistenceType"="ServiceControl.Audit.Persistence.RavenDb.RavenDbPersistenceConfiguration, ServiceControl.Audit.Persistence.RavenDb" | ||
| ENV "ServiceControl.Audit/Hostname"="*" | ||
|
|
||
| ENV "ServiceControl.Audit/DBPath"="C:\\Data\\DB\\" | ||
| ENV "ServiceControl.Audit/LogPath"="C:\\Data\\Logs\\" | ||
|
|
||
| # Defaults | ||
| ENV "ServiceControl.Audit/ForwardAuditMessages"="False" | ||
| ENV "ServiceControl.Audit/AuditRetentionPeriod"="365" | ||
| ENV "ServiceControl.Audit/DatabaseMaintenancePort"="44445" | ||
|
|
||
| EXPOSE 44444 | ||
| EXPOSE 44445 | ||
| ENV "ServiceControl.Audit/TransportType"="${TRANSPORT_CUSTOMIZATION_TYPE}" \ | ||
| "ServiceControl.Audit/PersistenceType"="ServiceControl.Audit.Persistence.RavenDb.RavenDbPersistenceConfiguration, ServiceControl.Audit.Persistence.RavenDb" \ | ||
| "ServiceControl.Audit/Hostname"="*" \ | ||
| "ServiceControl.Audit/DBPath"="C:\\Data\\DB\\" \ | ||
| "ServiceControl.Audit/LogPath"="C:\\Data\\Logs\\" \ | ||
| "ServiceControl.Audit/ForwardAuditMessages"="False" \ | ||
| "ServiceControl.Audit/AuditRetentionPeriod"="365" \ | ||
| "ServiceControl.Audit/DatabaseMaintenancePort"="44445" \ | ||
| "SERVICECONTROL_RUNNING_IN_DOCKER"="true" | ||
|
|
||
| VOLUME [ "C:/Data" ] | ||
|
|
||
| EXPOSE 44444 44445 | ||
|
|
||
| ENTRYPOINT ["ServiceControl.Audit.exe", "--portable"] |
26 changes: 11 additions & 15 deletions
26
...rviceControl.DockerImages/servicecontrol.transport.audit.init-windows.dockerfile-template
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.