이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 3. Developing with Docker in CodeReady Studio


3.1. Managing Docker connections

3.1.1. Setting up a Docker account

The following section describes how to set up a Docker account in CodeReady Studio.

Prerequisites

Procedure

  1. Start CodeReady Studio.
  2. Click Window Preferences.

    The Preferences window appears.

  3. Enter Registry Accounts in the search field.
  4. Select Registry Accounts.
  5. Click Add.

    The New Registry Account window appears.

  6. Enter the Server Address.
  7. Enter your Doker ID as the Username.
  8. Enter the email associated with your Docker account.
  9. Enter your password.
  10. Click OK.
  11. Click Apply and Close.

Your Docker account has been set up.

3.1.2. Testing an existing Docker connection

Prerequisites

  • A set up Docker account in CodeReady Studio.

    For more information on how to set up a Docker account in CodeReady Studio, see Setting up a Docker account.

Procedure

  1. Start CodeReady Studio.
  2. Click Window Show View Other.

    The Show View window appears.

  3. Enter Docker in the search field.
  4. Select Docker Explorer.
  5. Click Open.

    The Docker Explorer view appears.

  6. Right-click Docker socket Edit.

    The Edit Docker Connection window appears.

  7. Click Test Connection.

    If the connection is configured correctly, a window stating Ping succeeded! appears.

  8. Click OK.
  9. Click Finish.

3.1.3. Editing a Docker connection

Prerequisites

  • A set up Docker account in CodeReady Studio.

    For more information on how to set up a Docker account in CodeReady Studio, see Setting up a Docker account.

Procedure

  1. Start CodeReady Studio.
  2. Click Window Show View Other.

    The Show View window appears.

  3. Enter Docker in the search field.
  4. Select Docker Explorer.
  5. Click Open.

    The Docker Explorer view appears.

  6. Right-click Docker socket Edit.

    The Edit Docker Connection window appears.

  7. Click Browse in the Unix socket Location field to locate a new socket or check the TCP Connection option and add the URI.
  8. Click Finish.

3.2. Managing Docker images

3.2.1. Pulling Docker images

Procedure

  1. Start CodeReady Studio.
  2. Click Window Show View Other.

    The Show View window appears.

  3. Enter Docker in the search field.
  4. Select Docker Explorer.
  5. Click Open.

    The Docker Explorer view appears.

  6. Expand the Docker socket folder.
  7. Right-click Images Pull.

    The Pull Image window appears.

  8. Click Search.

    The Search the Docker Registry for images window appears.

  9. Enter your image name into the search field.
  10. Click Next.

    The Choose a tag for the selected image window appears.

  11. Choose a tag for your image.
  12. Click Finish.

    The Pull an image or a repository from the registry window appears.

  13. Click Finish.

You new Docker image is now listed in the Docker Explorer view.

3.2.2. Pushing Docker images

Before pushing an image you must tag it. The following section describes how to tag and push a Docker image in CodeReady Studio.

Procedure

  1. Start CodeReady Studio.
  2. Click Window Show View Other.

    The Show View window appears.

  3. Enter Docker in the search field.
  4. Select Docker Explorer.
  5. Click Open.

    The Docker Explorer view appears.

  6. Expand Docker socket Images.
  7. Right-click the image you want to tag.
  8. Click Add tag.

    The Tag Image window appears.

  9. Enter your tag in the New Tag field.

    The tag should be in the form of username/image_name:tag_name, where username is your Docker ID on hub.docker.com, image_name is the name of your image, and tag_name is the version of your image.

  10. Click Finish.
  11. Right-click the tagged image Push.

    The Push image to Registry window appears.

  12. Select the Registry Account that starts with your Docker ID.
  13. Click Finish.

After you push the image it appears in the Docker Cloud. This image is then available for other developers to use.

3.2.3. Running Docker images

Procedure

  1. Start CodeReady Studio.
  2. Click Window Show View Other.

    The Show View window appears.

  3. Enter Docker in the search field.
  4. Select Docker Explorer.
  5. Click Open.

    The Docker Explorer view appears.

  6. Expand Docker socket Images.
  7. Right-click images you want to run.
  8. Click Run.

    The Docker Container settings window appears.

  9. Name the container.
  10. Clear the Publish all exposed ports to random ports on the host interfaces check box.
  11. Check the box for the 8080 port.
  12. Click Finish.

    The Console view appears showing the process of starting the image.

  13. In the web browser, navigate to http://localhost:8080/ to see the image running.

3.2.4. Building images with Dockerfile

You can build or create an image by modifying an existing image. Typically, this involves installing new packages. The specification of the new Docker image is done via a the Dockerfile.

Prerequisites

  • You must have a Dockerfile created on your local machine.

    For more information on how to create a Dockerfile, see Creating a Dockerfile.

Procedure

  1. Start CodeReady Studio.
  2. Click Window Show View Other.

    The Show View window appears.

  3. Enter Docker in the search field.
  4. Select Docker Images.
  5. Click Open.

    The Docker Images view appears.

  6. Click the Build Image icon.

    The Build a Docker Image window appears.

  7. Name the image in the format of repo/name:version.
  8. Click Browse to locate the Dockerfile.
  9. Click Finish.

The Console view appears displaying the build process.

3.3. Managing Docker Containers

Docker containers are isolated processes that are based on Docker images. Once created, users can stop, start, pause, unpause, kill, or remove the containers as well as read their logs.

The following section describes how to manage Docker containers in CodeReady Studio.

Procedure

  1. Start CodeReady Studio.
  2. Click Window Show View Other.

    The Show View window appears.

  3. Enter Docker into the search field.
  4. Select Docker Containers.
  5. Click Open.

    The Docker Containers view appears.

You can start, pause, unpause, stop, kill, restart, remove, or refresh the containers by using the panel.

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat