This repository has been archived by the owner on Dec 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Docker container for building releases
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |