Cookie の設定を選択する

当社は、当社のサイトおよびサービスを提供するために必要な必須 Cookie および類似のツールを使用しています。当社は、パフォーマンス Cookie を使用して匿名の統計情報を収集することで、お客様が当社のサイトをどのように利用しているかを把握し、改善に役立てています。必須 Cookie は無効化できませんが、[カスタマイズ] または [拒否] をクリックしてパフォーマンス Cookie を拒否することはできます。

お客様が同意した場合、AWS および承認された第三者は、Cookie を使用して便利なサイト機能を提供したり、お客様の選択を記憶したり、関連する広告を含む関連コンテンツを表示したりします。すべての必須ではない Cookie を受け入れるか拒否するには、[受け入れる] または [拒否] をクリックしてください。より詳細な選択を行うには、[カスタマイズ] をクリックしてください。

Getting Started with Amazon Corretto 17 on Docker Images - Amazon Corretto 17
このページはお客様の言語に翻訳されていません。 翻訳のリクエスト

Getting Started with Amazon Corretto 17 on Docker Images

This topic describes how to build and launch a Docker image that uses Amazon Corretto 17. You must have the latest version of Docker installed.

Using the official image for Amazon Corretto 17.

Amazon Corretto 17 is available as an official image on Docker Hub. The following example runs a container and displays Corretto 17's version.

docker run amazoncorretto:17 java -version

Output:

openjdk version "17.0.14" 2025-01-21 LTS OpenJDK Runtime Environment Corretto-17.0.14.7.1 (build 17.0.14+7-LTS) OpenJDK 64-Bit Server VM Corretto-17.0.14.7.1 (build 17.0.14+7-LTS, mixed mode, sharing)

Using the Corretto ECR Instance

Note

The Corretto ECR Private Registry located at 489478819445.dkr.ecr.us-west-2.amazonaws.com/amazoncorretto is now deprecated. Please migrate existing usages to the Corretto ECR Public Gallery. See corretto-docker#154 for more information.

To use the Corretto ECR instance, run the following commands:

docker pull public.ecr.aws/amazoncorretto/amazoncorretto:17 docker run -it public.ecr.aws/amazoncorretto/amazoncorretto:17 /bin/bash

You can see the list of available images by going here:

Amazon Corretto on Alpine

Amazon Corretto on Alpine Linux images are available on Amazon ECR Public Gallery and Dockerhub

Using dockerhub

docker pull amazoncorretto:17-alpine-jdk docker run -it amazoncorretto:17-alpine-jdk /bin/sh

Build a Docker Image with Amazon Corretto 17

Run the following command to build an image that uses Amazon Corretto 17.

docker build -t amazon-corretto-17 github.com/corretto/corretto-docker#main:17/jdk/al2023

After the command completes, you have an image called amazon-corretto-17.

To launch this image locally, run the following command.

docker run -it amazon-corretto-17

You can also push this image to Amazon ECR. See the Pushing an Image topic in the Amazon Elastic Container Registry User Guide for details.

Create an Image

You can create a new Docker image using Corretto's official Docker Hub image.

  1. Create a Dockerfile with the following content.

    FROM amazoncorretto:17 RUN echo $' \ public class Hello { \ public static void main(String[] args) { \ System.out.println("Welcome to Amazon Corretto!"); \ } \ }' > Hello.java RUN javac Hello.java CMD ["java", "Hello"]
  2. Build the new image.

    docker build -t hello-app .
  3. Run the new image.

    docker run hello-app

    You get the following output.

    Welcome to Amazon Corretto!

プライバシーサイト規約Cookie の設定
© 2025, Amazon Web Services, Inc. or its affiliates.All rights reserved.