Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker container to run Berp #154

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
51 changes: 51 additions & 0 deletions docker-berp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Builds a docker image used for building most projects in this repo. It's
# used both by contributors and CI.
#
FROM mcr.microsoft.com/dotnet/sdk:6.0

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get install --assume-yes \
locales
luke-hill marked this conversation as resolved.
Show resolved Hide resolved

RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
luke-hill marked this conversation as resolved.
Show resolved Hide resolved
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

WORKDIR /app

RUN apt-get update && apt-get --assume-yes upgrade

# Create a cukebot user. Some tools (Bundler, npm publish) don't work properly
# when run as root
ENV USER=cukebot
ENV UID=1000
ENV GID=2000

RUN addgroup --gid "$GID" "$USER" \
&& adduser \
--disabled-password \
--gecos "" \
--ingroup "$USER" \
--uid "$UID" \
--shell /bin/bash \
"$USER"

## Trigger first run experience by running arbitrary cmd to populate local package cache
RUN dotnet --list-sdks

USER $USER

## As a user install node and npm via node version-manager
WORKDIR /home/$USER
luke-hill marked this conversation as resolved.
Show resolved Hide resolved

# Install Berp (dotnet tool installs are user-global; not system global)
RUN dotnet tool install --global Berp --version 1.4.0 \
&& echo 'export PATH="$PATH:/home/cukebot/.dotnet/tools"' >> ~/.bashrc

WORKDIR /app


CMD ["/bin/bash"]
20 changes: 20 additions & 0 deletions docker-berp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

# Docker container to run Berp

To use this container run from the root of the gherkin repository:

```plain
docker build -t berp-env docker-berp/ && docker run --rm -ti -v "$PWD:/app" berp-env
```

to start the container. The `/app` directory in the container corresponds to the
repository root.


From there, `berp` is installed in your `$PATH`, meaning you should be able to run

```
make generate
```

in the project root or in your language folder.