8000 feat: Fix issue #43 Add ARM64 support by ikyasam18 · Pull Request #61 · elastic/start-local · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: Fix issue #43 Add ARM64 support #61

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 79 additions & 6 deletions start-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -638,32 +638,66 @@ EOM
fi
echo
echo "Do you want to remove the following Docker images?"
echo "- docker.elastic.co/elasticsearch/elasticsearch:${es_version}"
EOM

if [ -z "${esonly:-}" ]; then
if is_arm64; then
cat >> uninstall.sh <<- EOM
echo "- docker.elastic.co/elasticsearch/elasticsearch:${es_version}-arm64"
EOM
if [ -z "${esonly:-}" ]; then
cat >> uninstall.sh <<- EOM
echo "- docker.elastic.co/kibana/kibana:${es_version}-arm64"
EOM
fi
else
cat >> uninstall.sh <<- EOM
echo "- docker.elastic.co/elasticsearch/elasticsearch:${es_version}"
EOM
if [ -z "${esonly:-}" ]; then
cat >> uninstall.sh <<- EOM
echo "- docker.elastic.co/kibana/kibana:${es_version}"
EOM
fi
fi

cat >> uninstall.sh <<- EOM
if ask_confirmation; then
EOM

if is_arm64; then
cat >> uninstall.sh <<- EOM
if docker rmi "docker.elastic.co/elasticsearch/elasticsearch:${es_version}-arm64" >/dev/null 2>&1; then
echo "Image docker.elastic.co/elasticsearch/elasticsearch:${es_version}-arm64 removed successfully"
else
echo "Failed to remove image docker.elastic.co/elasticsearch/elasticsearch:${es_version}-arm64. It might be in use."
fi
EOM
if [ -z "${esonly:-}" ]; then
cat >> uninstall.sh <<- EOM
if docker rmi docker.elastic.co/kibana/kibana:${es_version}-arm64 >/dev/null 2>&1; then
echo "Image docker.elastic.co/kibana/kibana:${es_version}-arm64 removed successfully"
else
echo "Failed to remove image docker.elastic.co/kibana/kibana:${es_version}-arm64. It might be in use."
fi
EOM
fi
else
cat >> uninstall.sh <<- EOM
if docker rmi "docker.elastic.co/elasticsearch/elasticsearch:${es_version}" >/dev/null 2>&1; then
echo "Image docker.elastic.co/elasticsearch/elasticsearch:${es_version} removed successfully"
else
echo "Failed to remove image docker.elastic.co/elasticsearch/elasticsearch:${es_version}. It might be in use."
fi
EOM

if [ -z "${esonly:-}" ]; then
cat >> uninstall.sh <<- EOM
if [ -z "${esonly:-}" ]; then
cat >> uninstall.sh <<- EOM
if docker rmi docker.elastic.co/kibana/kibana:${es_version} >/dev/null 2>&1; then
echo "Image docker.elastic.co/kibana/kibana:${es_version} removed successfully"
else
echo "Failed to remove image docker.elastic.co/kibana/kibana:${es_version}. It might be in use."
fi
EOM
fi
fi

cat >> uninstall.sh <<- EOM
Expand All @@ -679,7 +713,20 @@ create_docker_compose_file() {
cat > docker-compose.yml <<-'EOM'
services:
elasticsearch:
EOM

if is_arm64; then
cat >> docker-compose.yml <<-'EOM'
image: docker.elastic.co/elasticsearch/elasticsearch:${ES_LOCAL_VERSION}-arm64
platform: linux/arm64
EOM
else
cat >> docker-compose.yml <<-'EOM'
image: docker.elastic.co/elasticsearch/elasticsearch:${ES_LOCAL_VERSION}
EOM
fi

cat >> docker-compose.yml <<-'EOM'
container_name: ${ES_LOCAL_CONTAINER_NAME}
volumes:
- dev-elasticsearch:/usr/share/elasticsearch/data
Expand Down Expand Up @@ -734,7 +781,20 @@ if [ -z "${esonly:-}" ]; then
depends_on:
elasticsearch:
condition: service_healthy
EOM

if is_arm64; then
cat >> docker-compose.yml <<-'EOM'
image: docker.elastic.co/elasticsearch/elasticsearch:${ES_LOCAL_VERSION}-arm64
platform: linux/arm64
EOM
else
cat >> docker-compose.yml <<-'EOM'
image: docker.elastic.co/elasticsearch/elasticsearch:${ES_LOCAL_VERSION}
EOM
fi

cat >> docker-compose.yml <<-'EOM'
container_name: kibana_settings
restart: 'no'
command: >
Expand All @@ -755,7 +815,20 @@ if [ -z "${esonly:-}" ]; then
depends_on:
kibana_settings:
condition: service_completed_successfully
EOM

if is_arm64; then
cat >> docker-compose.yml <<-'EOM'
image: docker.elastic.co/kibana/kibana:${ES_LOCAL_VERSION}-arm64
platform: linux/arm64
EOM
else
cat >> docker-compose.yml <<-'EOM'
image: docker.elastic.co/kibana/kibana:${ES_LOCAL_VERSION}
EOM
fi

cat >> docker-compose.yml <<-'EOM'
container_name: ${KIBANA_LOCAL_CONTAINER_NAME}
volumes:
- dev-kibana:/usr/share/kibana/data
Expand Down Expand Up @@ -913,4 +986,4 @@ ctrl_c() {
trap ctrl_c INT

# Execute the script
main "$@"
main "$@"
Loading
0