Skip to content

Instantly share code, notes, and snippets.

@addaleax
Last active October 7, 2021 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save addaleax/2e67d0dfedda3eb34c4407bd97e421f0 to your computer and use it in GitHub Desktop.
Save addaleax/2e67d0dfedda3eb34c4407bd97e421f0 to your computer and use it in GitHub Desktop.
CentOS 7 Compass Test Dockerfile (Electron 13 branch)
# run as:
# docker build -t centos7-compass-test -f centos7-compass.Dockerfile .
# docker run --rm -it --network host --privileged -v /tmp:/tmp centos7-compass-test -c 'DISPLAY=:1 mongodb-compass-dev'
FROM centos:7
RUN yum install -y centos-release-scl epel-release
RUN yum repolist
RUN yum install -y python3 rpm-build dpkg-devel dpkg-dev cmake devtoolset-8 git
RUN scl enable devtoolset-8 bash
RUN bash -c 'source /opt/rh/devtoolset-8/enable && g++ --version && git --version'
# Compass-specific
RUN yum install -y libsecret-devel alsa-lib krb5-devel
# Add Node.js
RUN curl -sL https://rpm.nodesource.com/setup_14.x | bash -
RUN yum install -y nodejs
RUN npm install -g npm@7.19.x
# Clone Compass
RUN git clone --depth 10 --branch electron-13-same-keytar-node-14 https://github.com/mongodb-js/compass.git
RUN bash -c 'source /opt/rh/devtoolset-8/enable && cd compass && npm run bootstrap'
RUN bash -c 'source /opt/rh/devtoolset-8/enable && cd compass && npm run package-compass'
# Install Compass
RUN yum install -y compass/packages/compass/dist/mongodb-compass-dev-0.0.0-dev.0.x86_64.rpm
RUN chmod 4755 /usr/lib/mongodb-compass-dev/chrome-sandbox
RUN adduser test
USER test
ENTRYPOINT [ "bash" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment