{"id":37,"date":"2025-02-14T11:56:49","date_gmt":"2025-02-14T11:56:49","guid":{"rendered":"http:\/\/logicalday.site\/?p=37"},"modified":"2025-02-21T04:08:05","modified_gmt":"2025-02-21T04:08:05","slug":"docker-image-container-build","status":"publish","type":"post","link":"https:\/\/logicalday.site\/docker-image-container-build\/","title":{"rendered":"Docker – Image\/Container build"},"content":{"rendered":"\n

1. Building an image<\/strong> by pulli<\/strong>ng<\/h2>\n\n\n\n

Command:<\/p>\n\n\n\n

docker image pull <image_name><\/code><\/pre>\n\n\n\n

For example, I recently used:<\/p>\n\n\n\n

docker image pull nvcr.io\/nvidia\/pytorch:23.05-py3<\/code><\/pre>\n\n\n\n
\n\n\n\n

2. Building an image using Dockerfile<\/h2>\n\n\n\n

Create “Dockerfile”<\/strong> in your directory, and include the followings in the file:<\/p>\n\n\n\n

FROM <existing_image_name>\nRUN <commands you want to execute in terminal when the image is built><\/code><\/pre>\n\n\n\n

There are other commands you can contain.<\/p>\n\n\n\n