summaryrefslogtreecommitdiffstats
path: root/taskcluster/docker/firefox-snap/Dockerfile
blob: 5ab993b3b6976e96c686e9f25aee5174f5705ce5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
## The below code is from snapcraft/docker/stable.Dockerfile
## The modifications done are part of the documentation for enabling core18 snaps.
## https://snapcraft.io/docs/t/creating-docker-images-for-snapcraft/11739

FROM ubuntu:bionic

ENV LANG='en_US.UTF-8' \
    LANGUAGE='en_US:en' \
    LC_ALL='en_US.UTF-8' \
    PATH="/snap/bin:$PATH" \
    SNAP='/snap/snapcraft/current' \
    SNAP_NAME='snapcraft' \
    SNAP_ARCH='amd64' \
    TERM='dumb'

# Grab dependencies. snapd is now required per https://github.com/snapcore/snapcraft/pull/3210
RUN apt-get update && \
    apt-get dist-upgrade --yes && \
    apt-get install --yes \
      curl \
      jq \
      squashfs-tools \
      locales \
      bzip2 \
      curl \
      gcc \
      git \
      python3 \
      locales \
      snapd \
      sudo \
      && \
    apt-get clean && \
locale-gen "$LANG"

COPY download_and_install_snap.sh .

# Grab the core snap (for backwards compatibility)
RUN bash download_and_install_snap.sh 'core' 
# Grab the core18 snap (which snapcraft uses as a base)
RUN bash download_and_install_snap.sh 'core18'
RUN bash download_and_install_snap.sh 'gnome-3-34-1804'
RUN bash download_and_install_snap.sh 'gnome-3-34-1804-sdk'
RUN bash download_and_install_snap.sh 'snapcraft'

# Create a snapcraft runner (TODO: move version detection to the core of snapcraft).
RUN mkdir -p /snap/bin
RUN echo "#!/bin/sh" > /snap/bin/snapcraft
RUN snap_version="$(awk '/^version:/{print $2}' /snap/snapcraft/current/meta/snap.yaml)" && echo "export SNAP_VERSION=\"$snap_version\"" >> /snap/bin/snapcraft
RUN echo 'exec "$SNAP/usr/bin/python3" "$SNAP/bin/snapcraft" "$@"' >> /snap/bin/snapcraft
RUN chmod +x /snap/bin/snapcraft

RUN mkdir /scripts/
WORKDIR /scripts/
# Copy everything in the docker/firefox-snap folder but the Dockerfile
#
# XXX The following pattern is neither a regex nor a glob one. It's
# documented at https://golang.org/pkg/path/filepath/#Match. There's no
# way of explicitly filtering out "Dockerfile". If one day, someone needs
# to add a file starting with "D", then we must revisit the pattern below.
COPY [^D]* /scripts/

# Set a default command useful for debugging
CMD ["/bin/bash", "--login"]