AppCode 2023.1 Help

Docker images

Docker images are executable packages for running containers. Images are distributed via a Docker registry. By default, AppCode uses Docker Hub, which is a public registry with all the most common images, such as various Linux flavors, database management systems, web servers, and runtime environments. There are other public and private Docker registries, and you can also deploy your own registry server. For more information, see Configure a Docker registry.

To manage Docker images in AppCode, open the Services tool window (View | Tool Windows | Services or Alt+8), expand the configured Docker connection node Docker node, and then expand the Images node. For more information, see Images.

Depending on your development needs, you can use Docker for the following:

Configure a Docker registry

  1. In the Services tool window, click the Add Service button and select Docker Registry.

    Services tool window - Add Docker Registry
  2. In the New Docker Registry dialog, specify how to connect to the registry. When you specify the credentials, AppCode will automatically check the connection to the registry. The Connection successful message should appear at the bottom of the dialog.

    Add new Docker reistry

Alternatively, you can manage the list of configured Docker registries in Docker Registry settings.

Pull an image from a Docker registry

  1. In the Services tool window (View | Tool Windows | Services or Alt+8), select the Images node.

  2. Select the Docker registry and specify the repository and tag (name and version of the image, for example, postgres:latest.

    The Pull Image dialog
  3. Press Ctrl+Enter to run docker pull.

Specify the image as in the Docker CLI, for example: ubuntu:20.04.

Build an image from a Dockerfile

When you are editing a Dockerfile, AppCode provides completion for images from the configured registries.

  1. Open the Dockerfile from which you want to build the image.

  2. Click Run on Docker in the gutter and select to build the image.

    The Build Image on Docker popup

AppCode creates a Dockerfile run configuration that runs the docker build command.

Push an image to a Docker registry

  1. In the Services tool window, select the image that you want to upload and click The Push Image button or select Push Image from the context menu.

    The Push Image context menu item
  2. Select the Docker registry and specify the repository and tag (name and version of the image, for example, my-app:v2).

    The Push Image dialog
  3. Click OK to run the docker push command.

Copy image to another Docker daemon

If you have several Docker daemon connections, you can copy an image from one Docker daemon to another.

  1. In the Services tool window, select the image that you want to copy and click The Copy Docker Image button or select Copy Docker Image from the context menu.

  2. In the Copy Docker Image dialog, select the Docker daemon to which you want to copy the image and click Copy.

This first runs the docker save command to save the image from the current Docker daemon as a file, and then the docker load command to load the image from the file on the target Docker daemon.

AppCode stores images that you pull or build locally and lists them in the Services tool window under the Images node. When you select an image, you can view its name, ID, date of last changes, size, tags, and any containers using this image, if any. You can also create a new container from the selected image, push the image, or view the layers used by the image. Click the More button to see more actions: copy the image ID to the clipboard, run the docker image inspect command, or show labels applied to the image.

Docker image properties

Images with no tags <none>:<none> can be one of the following:

  • Intermediate images that serve as layers for other images and do not take up any space.

  • Dangling images that remain when you rebuild an image based on a newer version of another image. You should regularly prune dangling images to preserve disk space.

To hide untagged images from the list, click The Filter menu on the Docker toolbar, and remove the checkmark from Untagged Images.

To delete one or several images, select them in the list and click The Delete Image button.

Last modified: 03 April 2023