The base field created by snapcraft init should match the docker equivalent image or raise an error

Bug #1830388 reported by Evan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
New
Undecided
Unassigned

Bug Description

(See also https://bugs.launchpad.net/snapcraft/+bug/1830389)

Running snapcraft init inside the 16.04 snapcore/snapcraft docker produces a snapcraft.yaml with base: core18. You'll likely add some *-packages and this will break. Snapcraft init should select base: core if inside a 16.04 Docker, base: core18 if in 18.04 Docker, or error otherwise.

It may be worth moving the snapcore/snapcraft:latest, :beta, and :candidate images to 18.04 (but worth weighing the impact to existing users).

~/example❯ docker run -v $(pwd):$(pwd) -w $(pwd) snapcore/snapcraft:beta snapcraft init
Locale not set! Snapcraft will temporarily use C.UTF-8
Created snap/snapcraft.yaml.
Go to https://docs.snapcraft.io/the-snapcraft-format/8337 for more information about the snapcraft.yaml format.
~/example❯ cat snap/snapcraft.yaml
name: my-snap-name # you probably want to 'snapcraft register <name>'
base: core18 # the base snap is the execution environment for this snap
version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
  This is my-snap's description. You have a paragraph or two to tell the
  most important story about your snap. Keep it under 100 words though,
  we live in tweetspace and your description wants to look good in the snap
  store.

grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

parts:
  my-part:
    # See 'snapcraft plugins'
    plugin: nil

Evan (ev)
description: updated
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.