Skip to content

--disable-overlay disables overlay but doesn't place files in a useful place #945

@haxwithaxe

Description

@haxwithaxe

I'm trying to build an lxc image on a system that has zfs as the rootfs. When I run distrobuilder build-lxc distrobuilder.yml tmp-target --debug --cleanup=false --disable-overlay=true --cache-dir alpine-3.22-cache with or without --disable-overlay=true the scripts I have in the files section get transferred to the overlay directory in the cache and not the rootfs directory and they aren't available for the post-files action.

Also I created an ext4 zvol and tried building from there but it still detected the zfs filesystem and disabled the overlay automatically.

If that's the intended behavior then please ignore this. It would be nice if there was a more useful fallback behavior when the overlay isn't available.

This is my initial effort to use distrobuilder. Sorry if I'm missing something obvious.

For completeness here is the distrobuilder config I'm using:

image:
  name: alpine-3.22
  distribution: alpinelinux
  release: 3.22
  description: |-
    Alpine {{ image.release }} base image
  architecture: x86_64

source:
  downloader: alpinelinux-http
  same_as: 3.22
  url: https://dl-cdn.alpinelinux.org/alpine
  keys:
  - 0x0482D84022F52DF1C4E7CD43293ACD0907D9495A

targets:
  lxc:
    create_message: |-
      You just created an {{ image.description }} container.
    config:
    - type: all
      before: 5
      content: |-
        lxc.include = LXC_TEMPLATE_CONFIG/alpine.common.conf

    - type: user
      before: 5
      content: |-
        lxc.include = LXC_TEMPLATE_CONFIG/alpine.userns.conf

    - type: all
      after: 4
      content: |-
        lxc.include = LXC_TEMPLATE_CONFIG/common.conf

    - type: user
      after: 4
      content: |-
        lxc.include = LXC_TEMPLATE_CONFIG/userns.conf

    - type: all
      content: |-
        lxc.arch = {{ image.architecture_personality }}

files:
- path: /etc/hostname
  generator: hostname

- path: /etc/hosts
  generator: hosts

- path: /etc/machine-id
  generator: dump

- path: /var/lib/dbus/machine-id
  generator: remove

- path: /tmp/
  source: scripts
  generator: copy

packages:
  manager: apk
  update: true
  cleanup: true
  sets:
  - packages:
      - python3
      - py3-pip
      - py3-requests
      - py3-cryptography
      - git
      - pipx
      - openssh
    action: install

  repositories:
  - name: repositories
    url: |-
      http://dl-cdn.alpinelinux.org/alpine/v3.22/main
      http://dl-cdn.alpinelinux.org/alpine/v3.22/community
    architectures:
    - x86_64

actions:
  - trigger: post-files
    action: |-
      #!/bin/sh
      set -ex
      ls /tmp
      /tmp/scripts/ansible-pull.sh
      /tmp/scripts/cleanup.sh
      
mappings:
  architecture_map: alpinelinux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions