NetlifySaaS / FaaS

Debug Netlify build in our local env by using “Netlify Build Image”

We can build & deploy our own application by using Netlify. But, sometimes, we want to debug or test the b […]

広告ここから
広告ここまで

We can build & deploy our own application by using Netlify.

But, sometimes, we want to debug or test the build process in our local environment.

Today, I’ll introduce the “Netlify Build Image” to do this.

Pull the Docker image

The build image of Netlify is published in Dockerhub. So we can pull the images in our local.

$ docker pull netlify/build:xenial

Download the project

We need to download the GitHub repository in our local.

$ git clone git@github.com:netlify/build-image.git
$ cd build-image

Start the Container

We can start and access the container by the command.

$ ./test-tools/start-image.sh path/to/site/repo
buildbot@0605048257f4:/$ 

And we can run the build command like this.

$ /opt/build-bin/build npm run build

If you want to stop and exit the container, we just run exit command.

Build with cache

We can build the application with cache by the following command.

./test-tools/test-build.sh path/to/site/repo
 Using temp cache dir: tmp/tmp.oJosE3kthn/cache
 Cloning into '/opt/buildhome/repo'…

ブックマークや限定記事(予定)など

WP Kyotoサポーター募集中

WordPressやフロントエンドアプリのホスティング、Algolia・AWSなどのサービス利用料を支援する「WP Kyotoサポーター」を募集しています。
月額または年額の有料プランを契約すると、ブックマーク機能などのサポーター限定機能がご利用いただけます。

14日間のトライアルも用意しておりますので、「このサイトよく見るな」という方はぜひご検討ください。

広告ここから
広告ここまで

Related Category posts