Docker
No edit summary
(Adding template at the end of the page)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Docker desktop is an environment to run docker containers locally: https://www.docker.com/products/docker-desktop/
Docker Desktop is an environment to run docker containers locally. Find out more here: https://www.docker.com/products/docker-desktop/


Once you have docker desktop set up mysql:
Once you have Docker Desktop, set up MySQL:
  docker run -p 13306:3306 --name mysql2 -eMYSQL_ROOT_PASSWORD=123456 -d mysql:latest
  docker run -p 13306:3306 --name mysql2 -eMYSQL_ROOT_PASSWORD=123456 -d mysql:latest
To get MySQL running in docker check this guide: https://hevodata.com/learn/docker-mysql/#s1
To get MySQL running in Docker, check this guide: https://hevodata.com/learn/docker-mysql/#s1


Check what you run:
Check what you run:
  docker ps
  docker ps
To list existing docker images
To list existing docker images:
  docker images
  docker images
To manage mysql you can use MySQL Workbench: https://dev.mysql.com/downloads/workbench/
To manage MySQL, use MySQL Workbench: https://dev.mysql.com/downloads/workbench/


In mysql create a Schema called Db1 and in MDrivenServer set ConnectionType to MySQL and connection string to :
In MySQL, create a Schema called Db1, and in MDrivenServer, set ConnectionType to MySQL and connection string to:  
  Server=127.0.0.1;port=13306;Database=Db1;Uid=root;Pwd=123456;
  Server=127.0.0.1;port=13306;Database=Db1;Uid=root;Pwd=123456;
To create a docker image from a published .net app :
To create a Docker image from a published .net app:
  docker build -t mdriverserverimage -f Dockerfile .
  docker build -t mdriverserverimage -f Dockerfile .
Where the Dockerfile contains this:
where the Dockerfile is generated by Visual Studio by choosing the top-level project and choosing add-new/docker-support.
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
WORKDIR /App
<nowiki>#</nowiki> Copy everything
COPY . ./
WORKDIR .
EXPOSE 5000/tcp
ENTRYPOINT ["dotnet", "AppCompleteGenericCore.dll"]
When starting your web apps from visual studio set these settings to control port and use of http:
[[File:2023-04-17 17h17 16.png|none|thumb|526x526px]]If you run your MDrivenServer from a docker container - and connect to a MySQL in another docker container then remember that normally must be on the same network to be allowed to talk. Also remember to use port and ip from THAT docker network and not your external.


Since docker starts a network called bridge you can find out your mysql ip on that network like this:
When starting your web apps from Visual Studio, set these settings to control port and use of http:
[[File:2023-04-17 17h17 16.png|none|thumb|526x526px]]If you run your MDrivenServer from a Docker container - and connect to a MySQL in another Docker container - then remember that normally must be on the same network to be allowed to talk. Also, remember to use the port and IP from THAT Docker network and not your external.
 
Since Docker starts a network called bridge, you can find out your MySQL IP on that network like this:
docker inspect <container_id>


<code>docker inspect <container_id></code>
  Server=172.17.0.3;port=3306;Database=Db1;Uid=root;Pwd=123456;
  Server=172.17.0.3;port=3306;Database=Db1;Uid=root;Pwd=123456;
Build instructions - internal


Solutions have been moved up in the source tree to enable docker support:
=== Build instructions - Internal ===
Solutions have been moved up in the source tree to enable Docker support:
  C:\CapableObjectsWush\source\TurnkeyServerCore.sln and C:\CapableObjectsWush\source\MDrivenServerCore.sln
  C:\CapableObjectsWush\source\TurnkeyServerCore.sln and C:\CapableObjectsWush\source\MDrivenServerCore.sln
We aim to publish to the Docker hub: https://hub.docker.com/repository/docker/mdriven/mdrivenmain1
''Current status'': npm does not build when executing dockerfile+right-click+Build-docker-image
{{Edited|July|12|2024}}

Latest revision as of 14:46, 10 February 2024

Docker Desktop is an environment to run docker containers locally. Find out more here: https://www.docker.com/products/docker-desktop/

Once you have Docker Desktop, set up MySQL:

docker run -p 13306:3306 --name mysql2 -eMYSQL_ROOT_PASSWORD=123456 -d mysql:latest

To get MySQL running in Docker, check this guide: https://hevodata.com/learn/docker-mysql/#s1

Check what you run:

docker ps

To list existing docker images:

docker images

To manage MySQL, use MySQL Workbench: https://dev.mysql.com/downloads/workbench/

In MySQL, create a Schema called Db1, and in MDrivenServer, set ConnectionType to MySQL and connection string to:

Server=127.0.0.1;port=13306;Database=Db1;Uid=root;Pwd=123456;

To create a Docker image from a published .net app:

docker build -t mdriverserverimage -f Dockerfile .

where the Dockerfile is generated by Visual Studio by choosing the top-level project and choosing add-new/docker-support.

When starting your web apps from Visual Studio, set these settings to control port and use of http:

2023-04-17 17h17 16.png

If you run your MDrivenServer from a Docker container - and connect to a MySQL in another Docker container - then remember that normally must be on the same network to be allowed to talk. Also, remember to use the port and IP from THAT Docker network and not your external.

Since Docker starts a network called bridge, you can find out your MySQL IP on that network like this:

docker inspect <container_id>
Server=172.17.0.3;port=3306;Database=Db1;Uid=root;Pwd=123456;

Build instructions - Internal

Solutions have been moved up in the source tree to enable Docker support:

C:\CapableObjectsWush\source\TurnkeyServerCore.sln and C:\CapableObjectsWush\source\MDrivenServerCore.sln

We aim to publish to the Docker hub: https://hub.docker.com/repository/docker/mdriven/mdrivenmain1

Current status: npm does not build when executing dockerfile+right-click+Build-docker-image

This page was edited 92 days ago on 02/10/2024. What links here