From 1796f13e39addc6cc292d0848a7e47b2026dd696 Mon Sep 17 00:00:00 2001 From: Ellipse0934 <7466364+Ellipse0934@users.noreply.github.com> Date: Tue, 7 May 2024 19:36:07 +0530 Subject: [PATCH 1/7] feat: Add Dockerfile and corresponding instructions to README.md --- Dockerfile | 20 ++++++++++++++++++++ README.md | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0971d0a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM debian + +SHELL ["/bin/bash", "-c"] + +RUN apt-get update +RUN apt install -y git \ + python3 \ + python3-pytest \ + fasm \ + nodejs \ + wabt +RUN ln -s /usr/bin/python3 /usr/bin/python + +RUN groupadd -g 2000 bischebis \ +&& useradd -m -u 2001 -g bischebis bischebis + +USER bischebis +WORKDIR /home/bischebis +RUN git clone https://github.com/farkon00/cont +WORKDIR cont diff --git a/README.md b/README.md index 3ea4e18..744ffc1 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,15 @@ I just mixed beginning of that word and tried to come up with something, that so # Quick Start You can learn the language by using the ["Learn cont" manual](https://github.com/farkon00/cont/blob/master/learn-cont/00-learn-cont.md) -```bash +To use the language you need to install the following dependencies: +- python3 +- pip +- fasm +- nodejs +- wabt + +On debian/ubuntu based systems with APT you can do: +```console $ python3 -V Python >=3.10 @@ -26,6 +34,30 @@ $ pytest test.py $ python3 cont.py .cn -r ``` +Alternatively you may use the Dockerfile provided and work inside a container. + +In the cont directory +```bash +docker build --tag cont . +``` +Then +```bash +docker run -it cont /bin/bash +``` +```console +cont $ docker run -it cont /bin/bash +bischebis@6caa64b7c4b9:~/cont$ pytest test.py +=================================== test session starts =================================== +platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack +rootdir: /home/bischebis/cont +collected 40 items + +test.py ........................................ [100%] + +=================================== 40 passed in 2.52s ==================================== +bischebis@6caa64b7c4b9:~/cont$ +``` + # Examples You can find more examples in `tests` or `examples` folders or in the standard library source, which can be found in `std`. From a20dec60ab6f8b5ede2e4fba79ef059131297715 Mon Sep 17 00:00:00 2001 From: farkon00 <59134591+farkon00@users.noreply.github.com> Date: Wed, 8 May 2024 11:57:41 +0300 Subject: [PATCH 2/7] Fixed dependency information in the README --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 744ffc1..14331ad 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,11 @@ To use the language you need to install the following dependencies: - python3 - pip - fasm +- wabt(required only for the `wat64` target) +Also we recommend installing the following dependencies for testing purposes: - nodejs -- wabt -On debian/ubuntu based systems with APT you can do: +To setup directly on your machine: ```console $ python3 -V Python >=3.10 From ec14bed99198cc58361b9e3c0b1c6d1761dac4d1 Mon Sep 17 00:00:00 2001 From: Ellipse0934 <7466364+Ellipse0934@users.noreply.github.com> Date: Sat, 11 May 2024 15:31:29 +0530 Subject: [PATCH 3/7] feat: Copy local SRC to Dockerfile --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0971d0a..a4d0af7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,5 +16,6 @@ RUN groupadd -g 2000 bischebis \ USER bischebis WORKDIR /home/bischebis -RUN git clone https://github.com/farkon00/cont +RUN mkdir cont +COPY --chown=bischebis:bischebis . cont WORKDIR cont From 5084930d393074d73b7113faf1417a721b114a41 Mon Sep 17 00:00:00 2001 From: Ellipse0934 <7466364+Ellipse0934@users.noreply.github.com> Date: Sat, 11 May 2024 16:18:20 +0530 Subject: [PATCH 4/7] doc: Mount your local Volume --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 14331ad..669e247 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,14 @@ test.py ........................................ bischebis@6caa64b7c4b9:~/cont$ ``` +If you want to mount your local filesystem to the container then: +```sh +LOCALDIR=~/code/cont +``` +```sh +docker run -v $(LOCALDIR):/code -it cont /bin/bash +``` + # Examples You can find more examples in `tests` or `examples` folders or in the standard library source, which can be found in `std`. From 39ce6037e9092ab6f8a0fe59964cab80b50b1cde Mon Sep 17 00:00:00 2001 From: Ellipse0934 <7466364+Ellipse0934@users.noreply.github.com> Date: Sat, 11 May 2024 16:52:15 +0530 Subject: [PATCH 5/7] fix: Spelling bischebis -> bitchebis --- Dockerfile | 10 +++++----- README.md | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index a4d0af7..daac8fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,11 +11,11 @@ RUN apt install -y git \ wabt RUN ln -s /usr/bin/python3 /usr/bin/python -RUN groupadd -g 2000 bischebis \ -&& useradd -m -u 2001 -g bischebis bischebis +RUN groupadd -g 2000 bitchebis \ +&& useradd -m -u 2001 -g bitchebis bitchebis -USER bischebis -WORKDIR /home/bischebis +USER bitchebis +WORKDIR /home/bitchebis RUN mkdir cont -COPY --chown=bischebis:bischebis . cont +COPY --chown=bitchebis:bitchebis . cont WORKDIR cont diff --git a/README.md b/README.md index 669e247..53b4971 100644 --- a/README.md +++ b/README.md @@ -47,16 +47,16 @@ docker run -it cont /bin/bash ``` ```console cont $ docker run -it cont /bin/bash -bischebis@6caa64b7c4b9:~/cont$ pytest test.py +bitchebis@6caa64b7c4b9:~/cont$ pytest test.py =================================== test session starts =================================== platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack -rootdir: /home/bischebis/cont +rootdir: /home/bitchebis/cont collected 40 items test.py ........................................ [100%] =================================== 40 passed in 2.52s ==================================== -bischebis@6caa64b7c4b9:~/cont$ +bitchebis@6caa64b7c4b9:~/cont$ ``` If you want to mount your local filesystem to the container then: From a70a3db2457508e0ac191a0d730292643add4bba Mon Sep 17 00:00:00 2001 From: Ellipse0934 <7466364+Ellipse0934@users.noreply.github.com> Date: Sat, 11 May 2024 21:17:26 +0530 Subject: [PATCH 6/7] fix: Directory Mount Instructions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 53b4971..83e16cd 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ If you want to mount your local filesystem to the container then: LOCALDIR=~/code/cont ``` ```sh -docker run -v $(LOCALDIR):/code -it cont /bin/bash +docker run --mount type=bind,source=$LOCALDIR,target=/code -it cont /bin/bash ``` # Examples From 55c82065ac54175c337528cf487ed3a0b08069f0 Mon Sep 17 00:00:00 2001 From: Ellipse0934 <7466364+Ellipse0934@users.noreply.github.com> Date: Sat, 11 May 2024 21:32:03 +0530 Subject: [PATCH 7/7] fix: Remove user from Dockerfile --- Dockerfile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index daac8fa..96c8842 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,11 +11,7 @@ RUN apt install -y git \ wabt RUN ln -s /usr/bin/python3 /usr/bin/python -RUN groupadd -g 2000 bitchebis \ -&& useradd -m -u 2001 -g bitchebis bitchebis - -USER bitchebis -WORKDIR /home/bitchebis +WORKDIR / RUN mkdir cont -COPY --chown=bitchebis:bitchebis . cont +COPY . cont WORKDIR cont