mirror of
https://github.com/r-freeman/portfolio.git
synced 2024-11-23 10:25:42 +00:00
44 lines
1.9 KiB
Plaintext
44 lines
1.9 KiB
Plaintext
|
import Image from 'next/image'
|
||
|
import {ArticleLayout} from '@/components/layouts/ArticleLayout'
|
||
|
import {createSlug} from '@/lib/createSlug'
|
||
|
import cargoShipImage from './ian-taylor-jOqJbvo1P9g-unsplash.jpg'
|
||
|
|
||
|
export const meta = {
|
||
|
author: 'Ryan Freeman',
|
||
|
date: '2023-02-11',
|
||
|
title: 'Docker cheat sheet',
|
||
|
description: 'This is a living document of useful commands for maintaining and using Docker, and should function as a handy reference for developers and DevOps engineers.',
|
||
|
ogImage: '/static/images/ian-taylor-jOqJbvo1P9g-unsplash.jpg'
|
||
|
}
|
||
|
|
||
|
export default (props) => <ArticleLayout
|
||
|
author={meta.author}
|
||
|
date={meta.date}
|
||
|
title={meta.title}
|
||
|
description={meta.description}
|
||
|
ogImage={meta.ogImage}
|
||
|
slug={createSlug(meta.title)}
|
||
|
{...props} />
|
||
|
|
||
|
This is a living document of useful commands for maintaining and using Docker, and should function as a handy reference for developers and DevOps engineers.
|
||
|
|
||
|
<Image
|
||
|
src={cargoShipImage}
|
||
|
alt="Image of a cargo ship by Ian Taylor on Unsplash"
|
||
|
placeholder="blur"
|
||
|
priority
|
||
|
/>
|
||
|
|
||
|
## Cleaning up Docker images
|
||
|
|
||
|
If you update your Docker container images regularly using something like [watchtower](https://containrrr.dev/watchtower/), you might have dangling images which are out-of-date and no longer associated with some of your running containers.
|
||
|
|
||
|
So why not use `docker images prune` to reclaim that valuable disk space. For example, running this command on my Raspberry Pi shaved off about 9.66Gb of disk usage.
|
||
|
|
||
|
As a bonus, you can save some additional space using `docker images prune --all`, which removes all unused Docker images.
|
||
|
|
||
|
## Restarting all containers
|
||
|
|
||
|
Sometimes you want to restart all your containers at once, such as after you've pulled the latest images for your containers.
|
||
|
|
||
|
To do this, use `docker restart $(docker ps -q)`, this command instructs Docker to restart all containers using the container ids which are returned from `docker ps -q`.
|