Unverified Commit 4bba832f authored by Guillaume Lours's avatar Guillaume Lours Committed by GitHub
Browse files

Arm64 and check Compose v2 support (#177)



add support of arm64 architecture for the following samples: 
* aspnet-mssql
* elasticsearch-logstash-kibana
* nginx-aspnet-mysql
* nginx-flask-mysql
* nginx-golang-mysql
* react-java-mysql
* sparkjava-mysql
* wordpress-mysql
* react-express-mysql
* react-express-mongodb
Signed-off-by: default avatarGuillaume Lours <guillaume.lours@docker.com>
parent d48e8350
......@@ -20,7 +20,10 @@ services:
ports:
- 80:80
db:
image: microsoft/mssql-server-linux
# mssql server image isn't available for arm64 architecture, so we use azure-sql instead
image: mcr.microsoft.com/azure-sql-edge:1.0.4
# If you really want to use MS SQL Server, uncomment the following line
#image: mcr.microsoft.com/mssql/server
...
```
The compose file defines an application with two services `web` and `db`. The image for the web service is built with the Dockerfile inside the `app` directory (build parameter).
......@@ -28,6 +31,10 @@ The compose file defines an application with two services `web` and `db`. The im
When deploying the application, docker-compose maps the container port 80 to port 80 of the host as specified in the file.
Make sure port 80 on the host is not being used by another container, otherwise the port should be changed.
> ℹ️ **_INFO_**
> For compatibility purpose between `AMD64` and `ARM64` architecture, we use Azure SQL Edge as database instead of MS SQL Server.
> You still can use the MS SQL Server image by uncommenting the following line in the Compose file
> `#image: mcr.microsoft.com/mssql/server`
## Deploy with docker-compose
......
......@@ -7,7 +7,10 @@ services:
environment:
ACCEPT_EULA: "Y"
SA_PASSWORD: example_123
image: mcr.microsoft.com/mssql/server
# mssql server image isn't available for arm64 architecture, so we use azure-sql instead
image: mcr.microsoft.com/azure-sql-edge:1.0.4
# If you really want to use MS SQL Server, uncomment the following line
#image: mcr.microsoft.com/mssql/server
restart: always
healthcheck:
test: ["CMD-SHELL", "/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P example_123 -Q 'SELECT 1' || exit 1"]
......
......@@ -46,7 +46,7 @@ After the application starts, navigate to below links in your web browser:
* Elasticsearch: [`http://localhost:9200`](http://localhost:9200)
* Logstash: [`http://localhost:9600`](http://localhost:9600)
* Kibana: [`http://localhost:5601`](http://localhost:5601)
* Kibana: [`http://localhost:5601/api/status`](http://localhost:5601/api/status)
Stop and remove the containers
```
......
services:
elasticsearch:
image: elasticsearch:7.8.0
image: elasticsearch:7.14.2
container_name: es
environment:
discovery.type: single-node
......@@ -16,7 +16,7 @@ services:
networks:
- elastic
logstash:
image: logstash:7.8.0
image: logstash:7.14.2
container_name: log
environment:
discovery.seed_hosts: logstash
......@@ -35,7 +35,7 @@ services:
- elastic
command: logstash -f /usr/share/logstash/pipeline/logstash-nginx.config
kibana:
image: kibana:7.8.0
image: kibana:7.14.2
container_name: kib
ports:
- "5601:5601"
......
......@@ -24,7 +24,10 @@ services:
build: backend
...
db:
image: mysql:8.0.19
# We use a mariadb image which supports both amd64 & arm64 architecture
image: mariadb:10.6.4-focal
# If you really want to use MySQL, uncomment the following line
#image: mysql:8.0.27
...
proxy:
build: proxy
......@@ -36,6 +39,11 @@ The compose file defines an application with three services `proxy`, `backend` a
When deploying the application, docker-compose maps port 80 of the proxy service container to port 80 of the host as specified in the file.
Make sure port 80 on the host is not already being in use.
> ℹ️ **_INFO_**
> For compatibility purpose between `AMD64` and `ARM64` architecture, we use a MariaDB as database instead of MySQL.
> You still can use the MySQL image by uncommenting the following line in the Compose file
> `#image: mysql:8.0.27`
## Deploy with docker-compose
```
......
......@@ -3,6 +3,6 @@
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MySql.Data" Version="8.0.23" />
<PackageReference Include="MySqlConnector" Version="0.61.0" />
</ItemGroup>
</Project>
\ No newline at end of file
services:
backend:
build: backend
restart: always
secrets:
- db-password
depends_on:
- db
environment:
- ASPNETCORE_URLS=http://+:8000
depends_on:
db:
condition: service_healthy
# depends_on:
# db:
# condition: service_healthy
db:
image: mysql:8.0.19
# We use a mariadb image which supports both amd64 & arm64 architecture
image: mariadb:10.6.4-focal
# If you really want to use MySQL, uncomment the following line
#image: mysql:8.0.27
command: '--default-authentication-plugin=mysql_native_password'
restart: always
healthcheck:
......
......@@ -21,7 +21,10 @@ services:
build: backend
...
db:
image: mysql:8.0.19
# We use a mariadb image which supports both amd64 & arm64 architecture
image: mariadb:10.6.4-focal
# If you really want to use MySQL, uncomment the following line
#image: mysql:8.0.27
...
proxy:
build: proxy
......@@ -31,6 +34,11 @@ The compose file defines an application with three services `proxy`, `backend` a
When deploying the application, docker-compose maps port 80 of the proxy service container to port 80 of the host as specified in the file.
Make sure port 80 on the host is not already being in use.
> ℹ️ **_INFO_**
> For compatibility purpose between `AMD64` and `ARM64` architecture, we use a MariaDB as database instead of MySQL.
> You still can use the MySQL image by uncommenting the following line in the Compose file
> `#image: mysql:8.0.27`
## Deploy with docker-compose
```
......
services:
db:
image: mysql:8.0.19
# We use a mariadb image which supports both amd64 & arm64 architecture
image: mariadb:10.6.4-focal
# If you really want to use MySQL, uncomment the following line
#image: mysql:8.0.27
command: '--default-authentication-plugin=mysql_native_password'
restart: always
healthcheck:
......
......@@ -24,7 +24,10 @@ services:
build: backend
...
db:
image: mysql:8.0.19
# We use a mariadb image which supports both amd64 & arm64 architecture
image: mariadb:10.6.4-focal
# If you really want to use MySQL, uncomment the following line
#image: mysql:8.0.27
...
proxy:
build: proxy
......@@ -36,6 +39,11 @@ The compose file defines an application with three services `proxy`, `backend` a
When deploying the application, docker-compose maps port 80 of the proxy service container to port 80 of the host as specified in the file.
Make sure port 80 on the host is not already being in use.
> ℹ️ **_INFO_**
> For compatibility purpose between `AMD64` and `ARM64` architecture, we use a MariaDB as database instead of MySQL.
> You still can use the MySQL image by uncommenting the following line in the Compose file
> `#image: mysql:8.0.27`
## Deploy with docker-compose
```
......
......@@ -7,7 +7,10 @@ services:
db:
condition: service_healthy
db:
image: mysql:8.0.19
# We use a mariadb image which supports both amd64 & arm64 architecture
image: mariadb:10.6.4-focal
# If you really want to use MySQL, uncomment the following line
#image: mysql:8.0.27
command: '--default-authentication-plugin=mysql_native_password'
restart: always
healthcheck:
......
......@@ -7,11 +7,7 @@ exports.connect = (app) => {
const options = {
useNewUrlParser: true,
autoIndex: false, // Don't build indexes
reconnectTries: 30, // Retry up to 30 times
reconnectInterval: 500, // Reconnect every 500ms
poolSize: 10, // Maintain up to 10 socket connections
// If not connected, return errors immediately rather than waiting for reconnect
bufferMaxEntries: 0,
maxPoolSize: 10, // Maintain up to 10 socket connections
};
const connectWithRetry = () => {
......@@ -24,7 +20,7 @@ exports.connect = (app) => {
app.emit("ready");
})
.catch((err) => {
console.log("MongoDB connection unsuccessful, retry after 2 seconds.");
console.log("MongoDB connection unsuccessful, retry after 2 seconds.", err);
setTimeout(connectWithRetry, 2000);
});
};
......
# Create image based on the official Node image from dockerhub
FROM node:lts-buster-slim
FROM node:lts-buster
# Create app directory
WORKDIR /usr/src/app
......
......@@ -8,7 +8,7 @@
"@testing-library/user-event": "^7.2.1",
"axios": "^0.21.4",
"bootstrap": "^4.3.1",
"node-sass": "^6.0.1",
"sass": "^1.43.4",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "^4.0.3"
......
......@@ -27,7 +27,10 @@ services:
- 9230:9230
...
db:
image: mysql:8.0.19
# We use a mariadb image which supports both amd64 & arm64 architecture
image: mariadb:10.6.4-focal
# If you really want to use MySQL, uncomment the following line
#image: mysql:8.0.27
...
frontend:
build: frontend
......@@ -39,6 +42,11 @@ The compose file defines an application with three services `frontend`, `backend
When deploying the application, docker-compose maps port 3000 of the frontend service container to port 3000 of the host as specified in the file.
Make sure port 3000 on the host is not already being in use.
> ℹ️ **_INFO_**
> For compatibility purpose between `AMD64` and `ARM64` architecture, we use a MariaDB as database instead of MySQL.
> You still can use the MySQL image by uncommenting the following line in the Compose file
> `#image: mysql:8.0.27`
## Deploy with docker-compose
```
......
......@@ -28,7 +28,10 @@ services:
depends_on:
- db
db:
image: mysql:8.0.19
# We use a mariadb image which supports both amd64 & arm64 architecture
image: mariadb:10.6.4-focal
# If you really want to use MySQL, uncomment the following line
#image: mysql:8.0.27
command: '--default-authentication-plugin=mysql_native_password'
restart: always
secrets:
......
......@@ -23,7 +23,10 @@ services:
build: backend
...
db:
image: mysql:8.0.19
# We use a mariadb image which supports both amd64 & arm64 architecture
image: mariadb:10.6.4-focal
# If you really want to use MySQL, uncomment the following line
#image: mysql:8.0.27
...
frontend:
build: frontend
......@@ -35,6 +38,11 @@ The compose file defines an application with three services `frontend`, `backend
When deploying the application, docker-compose maps port 3000 of the frontend service container to port 3000 of the host as specified in the file.
Make sure port 3000 on the host is not already being in use.
> ℹ️ **_INFO_**
> For compatibility purpose between `AMD64` and `ARM64` architecture, we use a MariaDB as database instead of MySQL.
> You still can use the MySQL image by uncommenting the following line in the Compose file
> `#image: mysql:8.0.27`
## Deploy with docker-compose
```
......
......@@ -13,10 +13,13 @@ services:
db:
condition: service_healthy
db:
# We use a mariadb image which supports both amd64 & arm64 architecture
image: mariadb:10.6.4-focal
# If you really want to use MySQL, uncomment the following line
#image: mysql:8.0.19
environment:
MYSQL_DATABASE: example
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db-password
image: mysql:8.0.19
- MYSQL_DATABASE=example
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db-password
restart: always
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "--silent"]
......
......@@ -22,13 +22,21 @@ services:
ports:
- 8080:8080
db:
image: mysql:8.0.19
# We use a mariadb image which supports both amd64 & arm64 architecture
image: mariadb:10.6.4-focal
# If you really want to use MySQL, uncomment the following line
#image: mysql:8.0.27
...
```
The compose file defines an application with two services `backend` and `db`.
When deploying the application, docker-compose maps port 8080 of the backend service container to port 80 of the host as specified in the file.
Make sure port 8080 on the host is not already being in use.
> ℹ️ **_INFO_**
> For compatibility purpose between `AMD64` and `ARM64` architecture, we use a MariaDB as database instead of MySQL.
> You still can use the MySQL image by uncommenting the following line in the Compose file
> `#image: mysql:8.0.27`
## Deploy with docker-compose
```
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment