# Automatically build after file change

DevFeed: [Automatically build after file change](<https://devfeed.tech/articles/automatically-build-after-file-change-27639.md>)

Original publisher: [Read original article](<https://gagor.pro/2016/02/automatically-build-after-file-change/>)

Author: Tom

Published: 2016-02-23T00:00:00Z

Content type: tutorial

Language: en

Sources: [Tomasz Gągor](<https://devfeed.tech/sources/tomasz-gagor.md>)

Topics: [Docker](<https://devfeed.tech/topics/docker.md>), [Linux](<https://devfeed.tech/topics/linux.md>), [apt](<https://devfeed.tech/topics/apt.md>)

Tags: [apt](<https://devfeed.tech/tags/apt.md>), [bash](<https://devfeed.tech/tags/bash.md>), [build](<https://devfeed.tech/tags/build.md>), [commands](<https://devfeed.tech/tags/commands.md>), [docker](<https://devfeed.tech/tags/docker.md>), [install](<https://devfeed.tech/tags/install.md>), [linux](<https://devfeed.tech/tags/linux.md>), [macos](<https://devfeed.tech/tags/macos.md>)

## AI overview

A short tutorial explains how to automatically rebuild Docker images whenever files change in the current directory, using inotify-tools on Linux and a corresponding tool on macOS. It also notes how to exit the loop.

## Source excerpt

I'm playing a lot with Docker lately. Building images, and then rebuilding, and then building again... It's pretty boring. To automate this task a little I used inotify to build automatically after I changed any file. This trick could be used in many different situations. On Linux You will need inotify-tools package: Install inotify-tools on Linux sudo apt-get install -y inotify-tools Then run something like this: