Movatterモバイル変換


[0]ホーム

URL:


ContentsMenuExpandLight modeDark modeAuto light/dark, in light modeAuto light/dark, in dark modeSkip to content
Snapcraft 8.13.2 documentation
Snapcraft 8.13.2 documentation
Back to top

Build environment options

Snapcraft can optionally use the following arguments to modify the build environment.

Snapcraft Argument

Description

Notes

--destructive-mode

Destructive mode. Designed to be used in scenarios where additionalprovisioning of the build environment is required. This is not recommendedbecause the buildcould contaminate the host build environment.

Seedestructive mode.

--use-lxd

Builds the snap usingLXDrather than Multipass. This can potentially reduce resource usage, especiallyfrom a VM.

Requires LXD. For more information, seeSelect a build provider.

--http-proxy<http-proxy>

Configures HTTP proxy. Snapcraft will honor thehttp_proxy environmentvariable as well.

None.

--https-proxy<https-proxy>

Configures HTTPS proxy. Snapcraft will honor thehttps_proxy environmentvariable as well.

None.

--bind-ssh

Bind the~/.ssh directory to the local build instance.

Requires LXD or Multipass. Only available when building core22 snaps.

--ua-token<token>

Configure the build environment with ESM using specified UA token.

Requires LXD or Multipass. Only works for snaps built on core22.

--enable-manifest

Add the build manifest to the snap package insnap/manifest.yaml. Thiscontains the specific sources and packages used to build the snap and allows theSnap Store toautomatically check your snap for security issues.This option can also be used by setting the environment variableSNAPCRAFT_BUILD_INFO=1.

Snaps built on Launchpad will have this setautomatically. For snaps newer than core22, the command-line flag is deprecatedand removed. The environment variable will still work.

Destructive mode

Destructive mode builds the snap directly on the machine where Snapcraft is run withoutlaunching a build container. It is not recommended to use this option because Snapcraftcannot control the build environment. It is especially not recommended to use a personalmachine or in a shared environment, where operations like adding package repositoriesmay be disruptive.

The build environment should match the snap base. For example, a core24 snap should bebuilt inside of an Ubuntu 24.04 environment.

For core22 and newer snaps, the user must have root-level permissions so that they cando operations such as installing snaps and apt packages and adding package repositorieswithout needing to use sudo.

While destructive mode can be used in CI to save time, using an OCI image or a LXDcontainer is recommended. Seesnapcraft rocks for OCI images that can be used withDocker to build snaps. For projects in GitHub, theaction-build workflow is a good option.

Contents

[8]ページ先頭

©2009-2025 Movatter.jp