Build snap in bitbucket pipeline multipass is required


I am trying to build snap in bitbucket pipeline.

When I run this image I get this error You need 'multipass' set-up to build snaps:

But the build works in self-hosted runner. Why is that?

FROM ubuntu:18.04

ENV container docker
ENV PATH "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"

RUN apt-get update &&\
    apt-get install -y jq vim squashfs-tools curl git gcc g++ make cmake \
    net-tools iputils-ping openssh-client iproute2 \
    fuse snapd snap-confine squashfuse sudo init locales && locale-gen en_US.UTF-8 &&\
    apt-get clean &&\
    dpkg-divert --local --rename --add /sbin/udevadm &&\
    curl -fsSL | sudo -E bash - && \
    apt-get install -y nodejs && \
    ln -s /bin/true /sbin/udevadm && \
    systemctl enable snapd && \
    mkdir -p root/.ssh

# dependencies for the snap. This is to make the snap build faster
RUN apt-get install -y  adwaita-icon-theme at-spi2-core autoconf automake autopoint autotools-dev bsdmainutils build-essential\
   dconf-gsettings-backend dconf-service debhelper dh-autoreconf dh-strip-nondeterminism dpkg-dev fakeroot fontconfig\
   fontconfig-config fonts-dejavu-core gettext gettext-base gir1.2-atk-1.0 gir1.2-atspi-2.0 gir1.2-freedesktop\
   gir1.2-gdkpixbuf-2.0 gir1.2-gtk-3.0 gir1.2-harfbuzz-0.0 gir1.2-pango-1.0 glib-networking glib-networking-common\
   glib-networking-services groff-base gsettings-desktop-schemas gtk-update-icon-cache hicolor-icon-theme\
   humanity-icon-theme icu-devtools intltool-debian libalgorithm-diff-perl libalgorithm-diff-xs-perl\
   libalgorithm-merge-perl libarchive-cpio-perl libarchive-zip-perl libatk-bridge2.0-0 libatk-bridge2.0-dev libatk1.0-0\
   libatk1.0-data libatk1.0-dev libatspi2.0-0 libatspi2.0-dev libavahi-client3 libavahi-common-data libavahi-common3\
   libcairo-gobject2 libcairo-script-interpreter2 libcairo2 libcairo2-dev libcolord2 libcroco3 libcups2 libdatrie1\
   libdbus-1-dev libdconf1 libdpkg-perl libdrm-amdgpu1 libdrm-common libdrm-dev libdrm-intel1 libdrm-nouveau2\
   libdrm-radeon1 libdrm2 libegl-mesa0 libegl1 libegl1-mesa-dev libelf1 libepoxy-dev libepoxy0 libexpat1-dev libfakeroot\
   libfile-fcntllock-perl libfile-stripnondeterminism-perl libfontconfig1 libfontconfig1-dev libfreetype6\
   libfreetype6-dev libgbm1 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-bin libgdk-pixbuf2.0-common libgdk-pixbuf2.0-dev libgl1\
   libgl1-mesa-dri libglapi-mesa libgles1 libgles2 libglib2.0-bin libglib2.0-dev libglib2.0-dev-bin libglvnd-core-dev\
   libglvnd-dev libglvnd0 libglx-mesa0 libglx0 libgraphite2-3 libgraphite2-dev libgtk-3-0 libgtk-3-bin libgtk-3-common\
   libgtk-3-dev libharfbuzz-dev libharfbuzz-gobject0 libharfbuzz-icu0 libharfbuzz0b libice-dev libice6 libicu-dev\
   libicu-le-hb-dev libicu-le-hb0 libiculx60 libjbig0 libjpeg-turbo8 libjpeg8 libjson-glib-1.0-0 libjson-glib-1.0-common\
   liblcms2-2 libllvm10 liblocale-gettext-perl libltdl-dev libltdl7 libmail-sendmail-perl libopengl0 libpango-1.0-0\
   libpango1.0-dev libpangocairo-1.0-0 libpangoft2-1.0-0 libpangoxft-1.0-0 libpciaccess0 libpcre16-3 libpcre3-dev\
   libpcre32-3 libpcrecpp0v5 libpipeline1 libpixman-1-0 libpixman-1-dev libpng-dev libpng-tools libpng16-16 libproxy1v5\
   libpthread-stubs0-dev librest-0.7-0 librsvg2-2 librsvg2-common libsensors4 libsigsegv2 libsm-dev libsm6\
   libsoup-gnome2.4-1 libsoup2.4-1 libsys-hostname-long-perl libthai-data libthai0 libtiff5 libtimedate-perl libtool\
   libwayland-bin libwayland-client0 libwayland-cursor0 libwayland-dev libwayland-egl1 libwayland-server0 libx11-dev\
   libx11-doc libx11-xcb-dev libx11-xcb1 libxau-dev libxcb-dri2-0 libxcb-dri2-0-dev libxcb-dri3-0 libxcb-dri3-dev\
   libxcb-glx0 libxcb-glx0-dev libxcb-present-dev libxcb-present0 libxcb-randr0 libxcb-randr0-dev libxcb-render0\
   libxcb-render0-dev libxcb-shape0 libxcb-shape0-dev libxcb-shm0 libxcb-shm0-dev libxcb-sync-dev libxcb-sync1\
   libxcb-xfixes0 libxcb-xfixes0-dev libxcb1-dev libxcomposite-dev libxcomposite1 libxcursor-dev libxcursor1\
   libxdamage-dev libxdamage1 libxdmcp-dev libxext-dev libxfixes-dev libxfixes3 libxft-dev libxft2 libxi-dev libxi6\
   libxinerama-dev libxinerama1 libxkbcommon-dev libxkbcommon0 libxrandr-dev libxrandr2 libxrender-dev libxrender1\
   libxshmfence-dev libxshmfence1 libxtst-dev libxtst6 libxxf86vm-dev libxxf86vm1 m4 man-db mesa-common-dev pkg-config\
   po-debconf python3-distutils python3-lib2to3 ubuntu-mono ucf wayland-protocols x11-common x11proto-composite-dev\
   x11proto-core-dev x11proto-damage-dev x11proto-dev x11proto-fixes-dev x11proto-input-dev x11proto-randr-dev\
   x11proto-record-dev x11proto-xext-dev x11proto-xf86vidmode-dev x11proto-xinerama-dev xkb-data xorg-sgml-doctools\
   xtrans-dev zlib1g-dev

# Manually install the core snap, a dependency of the snapcraft snap
RUN curl -L $(curl -H "X-Ubuntu-Series: 16" "" | jq ".download_url" -r) --output core.snap && \
	sudo mkdir -p /snap/core && \
	sudo unsquashfs -d /snap/core/current core.snap && \
	rm -f core.snap

# Manually install the core18 snap, the main point of this image
RUN curl -L $(curl -H "X-Ubuntu-Series: 16" "" | jq ".download_url" -r) --output core18.snap && \
	sudo mkdir -p /snap/core18 && \
	sudo unsquashfs -d /snap/core18/current core18.snap && \
	rm -f core18.snap

# Manually install the snapcraft snap, so we can use it to build new snaps
RUN curl -L $(curl -H "X-Ubuntu-Series: 16" "" | jq ".download_url" -r) --output snapcraft.snap && \
	sudo mkdir -p /snap/snapcraft && \
	sudo unsquashfs -d /snap/snapcraft/current snapcraft.snap && \
	rm -f snapcraft.snap

# Manually install the review-tools snap
RUN curl -L $(curl -H "X-Ubuntu-Series: 16" "" | jq ".download_url" -r) --output review-tools.snap && \
	sudo mkdir -p /snap/review-tools && \
	sudo unsquashfs -d /snap/review-tools/current review-tools.snap && \
	rm -f review-tools.snap

# Install the Snapcraft runner
COPY /snap/bin/snapcraft
# Install the snap review
COPY /snap/bin/snap-review

# Set the proper environment
ENV PATH=/snap/bin:$PATH

RUN chmod +x /snap/bin/snapcraft &&\
    chmod +x /snap/bin/snap-review

VOLUME ["/sys/fs/cgroup"]

CMD ["/sbin/init"]