Skip to content

Instantly share code, notes, and snippets.

@garrison
Last active August 5, 2022 00:35
Show Gist options
  • Save garrison/f025090ce914641f0d1e492612dcbd4e to your computer and use it in GitHub Desktop.
Save garrison/f025090ce914641f0d1e492612dcbd4e to your computer and use it in GitHub Desktop.
Sandstorm Docker builds
# buster compiles just fine.
# bullseye works, with some warnings about "not a dynamic executable" at the end. My own testing has shown that the resulting package works, as expected since Kenton claims on IRC to use bullseye.
FROM debian:bullseye
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y build-essential libcap-dev xz-utils zip \
unzip strace curl discount git python3 zlib1g-dev \
golang-go cmake strace flex bison locales
# Install meteor as a regular user; otherwise the build cannot find node.h.
RUN apt-get install -y sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN useradd -rm -d /home/builder -s /bin/bash -g root -G sudo -u 1001 builder
RUN chown builder /usr/src -R
USER builder
RUN curl https://install.meteor.com/ | sh
# FIXME: remove sudo access for builder
# Set USER, otherwise ./make-bundle.sh: line 219: USER: unbound variable
ENV USER=builder
WORKDIR /usr/src
RUN git clone https://github.com/sandstorm-io/sandstorm.git
WORKDIR /usr/src/sandstorm
RUN make fast
FROM fedora:36
RUN sudo dnf -y install make libcap-devel libstdc++-devel libstdc++-static \
glibc-headers glibc-static glibc-locale-source gcc-c++ xz zip \
unzip strace curl discount git python zlib-devel zlib-static \
golang cmake strace flex bison which diffutils
# Install meteor as a regular user; otherwise the build cannot find node.h.
# (or at least that was my experience on debian)
#RUN dnf -y install sudo
RUN echo '%wheel ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN useradd -rm -d /home/builder -s /bin/bash -g root -G wheel -u 1001 builder
RUN chown builder /usr/src -R
USER builder
RUN curl https://install.meteor.com/ | sh
# FIXME: remove sudo access for builder
# Set USER, otherwise ./make-bundle.sh: line 219: USER: unbound variable
ENV USER=builder
WORKDIR /usr/src
RUN git clone https://github.com/sandstorm-io/sandstorm.git
WORKDIR /usr/src/sandstorm
RUN make fast
@garrison
Copy link
Author

Be sure to use Docker 19.03 or higher so that strace works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment