Skip to content
This repository has been archived by the owner on Dec 30, 2024. It is now read-only.

Commit

Permalink
Add Docker container for building releases
Browse files Browse the repository at this point in the history
  • Loading branch information
electroly committed Feb 18, 2021
1 parent b111c8f commit bb9b5ca
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
24 changes: 24 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM ubuntu:20.04

RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
nodejs \
npm \
git

# unprivileged user
RUN mkdir -p /code && \
groupadd -g $HOST_GID $USER && \
useradd -r -u $HOST_UID -g $HOST_GID $USER && \
chown $HOST_UID:$HOST_GID /code && \
mkdir -p /home/$USER && \
chown $HOST_UID:$HOST_GID /home/$USER

USER $HOST_UID

# use https for git instead of ssh
RUN git config --global url."https://github.com/".insteadOf [email protected]: && \
git config --global url."https://".insteadOf git:// && \
git config --global url."https://".insteadOf ssh://

ENTRYPOINT "/bin/bash"
1 change: 1 addition & 0 deletions build/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This Docker environment is used for making release builds. Run `./buildenv.sh`.
12 changes: 12 additions & 0 deletions build/buildenv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -euxo pipefail

export IMAGE_NAME="chromeshack"
export HOST_UID=$(id -u "$USER")
export HOST_GID=$(id -g "$USER")

cat Dockerfile | envsubst | docker build -t $IMAGE_NAME -

pushd ..
docker run --rm --tty --interactive --volume "$PWD:/code" --workdir /code --name $IMAGE_NAME $IMAGE_NAME
popd

0 comments on commit bb9b5ca

Please sign in to comment.