Skip to content

Commit

Permalink
Merge pull request #127 from meganetaaan/fix/container
Browse files Browse the repository at this point in the history
Fix #126 renew docker image
  • Loading branch information
meganetaaan committed Mar 3, 2023
2 parents 18822c7 + 7648775 commit c5baa56
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 11 deletions.
7 changes: 5 additions & 2 deletions firmware/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"context": "..",

// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "../Dockerfile",
"dockerFile": "../docker/Dockerfile",

// Set *default* container specific settings.json values on container create.
// "settings": {
Expand All @@ -34,7 +34,10 @@

// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],
"mounts": ["source=/dev,target=/dev,type=bind"],
"mounts": [
"type=volume,source=stackchan_firmware_node_modules,target=/workspace/node_modules",
"type=bind,source=/dev,target=/dev,type=bind"
],

// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "root"
Expand Down
2 changes: 0 additions & 2 deletions firmware/build-container.sh

This file was deleted.

4 changes: 2 additions & 2 deletions firmware/Dockerfile → firmware/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM meganetaaan/moddable-esp32:moddable-ae5ed20
FROM meganetaaan/moddable-esp32:3.7.0
LABEL maintainer "Shinya Ishikawa<ishikawa.s.1027@gmail.com>"

RUN curl -SL https://deb.nodesource.com/setup_14.x | bash \
Expand All @@ -7,5 +7,5 @@ RUN curl -SL https://deb.nodesource.com/setup_14.x | bash \
nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN npm install -g typescript
RUN npm install --global typescript
RUN echo ". /opt/esp/idf/export.sh" >> /root/.bashrc
3 changes: 3 additions & 0 deletions firmware/docker/build-container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
# Run from `stack-chan/firmware`
docker build ./docker -t stack-chan/dev
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ xhost +local:
docker run \
--rm -it \
--privileged \
-v $PWD:/workspace \
--mount "type=volume,src=node_modules,dst=/workspace/node_modules" \
--mount "type=bind,src=${PWD},dst=/workspace" \
-v /dev:/dev \
-e DISPLAY=$DISPLAY \
--net=host \
Expand Down
6 changes: 4 additions & 2 deletions firmware/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ Note: This has been tested on Linux (Ubuntu 20.04); it may not work properly on

#### From terminal

Run the following command in the `stack-chan/firmware` directory.

```console
$ ./build-container.sh
$ ./launch-container.sh
$ ./docker/build-container.sh
$ ./docker/launch-container.sh

# Run inside container
$ npm install
Expand Down
6 changes: 4 additions & 2 deletions firmware/docs/getting-started_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ Dockerコンテナの中でファームウェアのビルド、書き込みと

#### ターミナルから

`stack-chan/firmware`ディレクトリで次のコマンドを実行します。

```console
$ ./build-container.sh
$ ./launch-container.sh
$ ./docker/build-container.sh
$ ./docker/launch-container.sh

# コンテナ内で以下を実行
$ npm install
Expand Down

0 comments on commit c5baa56

Please sign in to comment.