feat: Support building Docker image for ARM arch (#7832)
This commit is contained in:
parent
db13282a6f
commit
f37f9451ef
17
Dockerfile
17
Dockerfile
|
|
@ -1,4 +1,4 @@
|
|||
FROM debian:buster
|
||||
FROM ubuntu:20.04
|
||||
|
||||
LABEL maintainer="tech@appsmith.com"
|
||||
|
||||
|
|
@ -9,21 +9,20 @@ WORKDIR /opt/appsmith
|
|||
ENV LANG C.UTF-8
|
||||
ENV LC_ALL C.UTF-8
|
||||
|
||||
# Update APK packages - Base Layer
|
||||
# Update APT packages - Base Layer
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||
supervisor curl cron certbot nginx gnupg \
|
||||
redis wget gettext openjdk-11-jre \
|
||||
supervisor curl cron certbot nginx gnupg wget \
|
||||
software-properties-common gettext openjdk-11-jre \
|
||||
&& add-apt-repository ppa:redislabs/redis \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install MongoDB v4.0.5, Redis - Service Layer
|
||||
# Install MongoDB v4.0.5, Redis, NodeJS - Service Layer
|
||||
RUN wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add -
|
||||
RUN echo "deb [ arch=amd64,arm64 ]http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list \
|
||||
RUN echo "deb [ arch=amd64,arm64 ]http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list \
|
||||
&& apt-get remove wget -y
|
||||
|
||||
# Install node v14 - Service Layer
|
||||
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \
|
||||
&& apt-get -y install --no-install-recommends -y mongodb-org=4.4.6 nodejs \
|
||||
&& apt-get -y install --no-install-recommends -y mongodb-org=4.4.6 nodejs redis \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
|
|
|||
17
deploy/docker/build-multi-arch.md
Normal file
17
deploy/docker/build-multi-arch.md
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
## Goal
|
||||
- Build appsmith-ce image support multiple architecture (amd64 & arm64)
|
||||
|
||||
## Setup Build Environment
|
||||
- Follow docker buildx guide to setup buildx environment [https://docs.docker.com/buildx/working-with-buildx/](https://docs.docker.com/buildx/working-with-buildx/)
|
||||
- Command to setup buildx
|
||||
```
|
||||
docker buildx create --name builder --driver docker-container --use
|
||||
docker buildx inspect --bootstrap
|
||||
```
|
||||
|
||||
## Build
|
||||
- Run command below to build & push multi-arch image to docker registry
|
||||
```
|
||||
docker buildx build --platform linux/arm64,linux/amd64 --push -t appsmith/appsmith-ce .
|
||||
```
|
||||
- To read more option of `buildx build`, read more at: [https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md)
|
||||
2
deploy/docker/build-mutil-arch.sh
Normal file
2
deploy/docker/build-mutil-arch.sh
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
docker buildx build --platform linux/arm64,linux/amd64 --push -t appsmith/appsmith-ce .
|
||||
|
|
@ -33,8 +33,8 @@ init_mongodb() {
|
|||
mongod --fork --port 27017 --dbpath "$MONGO_DB_PATH" --logpath "$MONGO_LOG_PATH"
|
||||
echo "Waiting 10s for mongodb init"
|
||||
sleep 10
|
||||
bash "/opt/appsmith/templates/mongo-init.js.sh" "$APPSMITH_MONGO_USERNAME" "$APPSMITH_MONGO_PASSWORD" >"/appsmith-stacks/configuration/mongo-init.js"
|
||||
mongo "127.0.0.1/${APPSMITH_MONGO_DATABASE}" /appsmith-stacks/configuration/mongo-init.js
|
||||
bash "/opt/appsmith/templates/mongo-init.js.sh" "$MONGO_INITDB_ROOT_USERNAME" "$MONGO_INITDB_ROOT_PASSWORD" >"/appsmith-stacks/configuration/mongo-init.js"
|
||||
mongo "127.0.0.1/${MONGO_INITDB_DATABASE}" /appsmith-stacks/configuration/mongo-init.js
|
||||
echo "Seeding db done"
|
||||
|
||||
echo "Enable replica set"
|
||||
|
|
@ -136,7 +136,7 @@ configure_supervisord() {
|
|||
fi
|
||||
|
||||
cp -f "$SUPERVISORD_CONF_PATH/application_process/"*.conf /etc/supervisor/conf.d
|
||||
if [[ "$APPSMITH_MONGODB_URI" = "mongodb://appsmith:$APPSMITH_MONGO_PASSWORD@localhost/appsmith" ]]; then
|
||||
if [[ "$APPSMITH_MONGODB_URI" = "mongodb://appsmith:$MONGO_INITDB_ROOT_PASSWORD@localhost/appsmith" ]]; then
|
||||
cp "$SUPERVISORD_CONF_PATH/mongodb.conf" /etc/supervisor/conf.d/
|
||||
fi
|
||||
if [[ "$APPSMITH_REDIS_URL" = "redis://127.0.0.1:6379" ]]; then
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ APPSMITH_MAIL_HOST=
|
|||
APPSMITH_MAIL_PORT=
|
||||
APPSMITH_MAIL_USERNAME=
|
||||
APPSMITH_MAIL_PASSWORD=
|
||||
APPSMITH_MAIL_FROM=
|
||||
APPSMITH_REPLY_TO=
|
||||
|
||||
# Email server feature toggles
|
||||
# true | false values
|
||||
|
|
@ -67,9 +69,9 @@ APPSMITH_RECAPTCHA_SITE_KEY=
|
|||
APPSMITH_RECAPTCHA_SECRET_KEY=
|
||||
APPSMITH_RECAPTCHA_ENABLED=
|
||||
|
||||
APPSMITH_MONGO_USERNAME=appsmith
|
||||
APPSMITH_MONGO_PASSWORD=$MONGO_PASSWORD
|
||||
APPSMITH_MONGO_DATABASE=appsmith
|
||||
MONGO_INITDB_ROOT_USERNAME=appsmith
|
||||
MONGO_INITDB_ROOT_PASSWORD=$MONGO_PASSWORD
|
||||
MONGO_INITDB_DATABASE=appsmith
|
||||
APPSMITH_MONGO_HOST=localhost:27017
|
||||
APPSMITH_MONGODB_URI=mongodb://appsmith:$MONGO_PASSWORD@localhost/appsmith
|
||||
APPSMITH_API_BASE_URL=http://localhost:8080
|
||||
|
|
@ -83,4 +85,7 @@ APPSMITH_ENCRYPTION_SALT=$ENCRYPTION_SALT
|
|||
|
||||
APPSMITH_CUSTOM_DOMAIN=
|
||||
# APPSMITH_PLUGIN_MAX_RESPONSE_SIZE_MB=5
|
||||
|
||||
# MAX PAYLOAD SIZE
|
||||
# APPSMITH_CODEC_SIZE=
|
||||
EOF
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user