-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
56 lines (45 loc) · 2.07 KB
/
Dockerfile.dev
File metadata and controls
56 lines (45 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Using Ubuntu as base image
FROM ubuntu:latest
# Installing python, openjdk, git, curl, and other necessary packages
RUN apt-get update && \
apt-get install -y python2.7 openjdk-11-jre-headless git curl xz-utils
# Installing Node.js v16.20.0
RUN curl -fsSL https://nodejs.org/dist/v16.20.0/node-v16.20.0-linux-x64.tar.xz | tar -xJv -C /usr/local --strip-components=1
# Set the environment variables
ENV MBHome /Robotical/MartyBlocks
ENV mblib $MBHome/marty-blocks-lib
ENV REPLACEMENTS $MBHome/marty-blocks-lib/replacements
ENV blocks_original $MBHome/scratch-blocks
ENV vm_original $MBHome/scratch-vm
ENV gui_original $MBHome/scratch-gui
ENV NODE_OPTIONS "--max-old-space-size=5120"
ENV PATH="/root/.pyenv/shims:${PATH}"
# Set the workdir
WORKDIR $MBHome
# Clone repos
RUN git clone -b develop https://github.com/llk/scratch-blocks.git scratch-blocks
RUN git clone -b develop https://github.com/llk/scratch-vm.git scratch-vm
RUN git clone -b develop https://github.com/llk/scratch-gui.git scratch-gui
# Checkout appropriate commit
RUN cd $blocks_original && git reset --hard f9107bf5d0479d632658f2b203995f5ae6d75363
RUN cd $vm_original && git reset --hard 3b36a8e3ea7f3caa5b4bf4ae7b4f821a986a1378
RUN cd $gui_original && git reset --hard 738c86bb58e336711280aec33c510d7aef79408e
# Install scratch
RUN cd $blocks_original && npm install
RUN cd $vm_original && npm install
RUN cd $gui_original && npm install
# Install marty blocks library
RUN cd $mblib && npm install
# Link repositories
RUN cd $mblib && npm link
RUN cd $blocks_original && npm link && npm link marty-blocks-lib
RUN cd $vm_original && npm link && npm link marty-blocks-lib scratch-blocks
RUN cd $gui_original && npm link marty-blocks-lib scratch-blocks scratch-vm
# Build repositories and start scratch gui
RUN cd $mblib && npx node ./set-development.js
RUN cp -r $REPLACEMENTS/* $MBHome
RUN cd $blocks_original && ln -s $(npm root)/google-closure-library ../closure-library; npm run prepublish
RUN cd $vm_original && npm run build
RUN cd $gui_original && BUILD_MODE=dist npm run build
RUN cd $gui_original && npm start
CMD ["bash"]