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

Docker Images #1235

Merged
merged 5 commits into from
Oct 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Dockerfile

This file was deleted.

16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,10 @@ npm run build

### Building the extension's source code via docker

Make sure that you have docker installed.
Make sure that you have docker installed and follow one of the links below:

```sh
docker build -t vscode-icons .
docker run --rm -it -v $PWD/dist:/app/dist vscode-icons
```

All of the files will be generated in the `dist` folder.
[If you want to develop or build the app](https://github.com/vscode-icons/vscode-icons/blob/master/docker/development/README.md).
[If you want to get the result of the latest published build](https://github.com/vscode-icons/vscode-icons/blob/master/docker/remote-builder/README.md)

## Change log

Expand All @@ -402,6 +398,10 @@ If you feel that there's some icon missing please report it to the Github reposi

## Versioning

vscode-icons follows [Semantic Versioning 2.0.0](http://semver.org/).
`vscode-icons` follows [Semantic Versioning 2.0.0](http://semver.org/).

## Related extensions

- [vscode-icons for GitHub](https://github.com/dderevjanik/github-vscode-icons) by [@dderevjanik](https://github.com/dderevjanik) will allow you to see all `Github`'s files with `vscode-icons` icons.

**Enjoy!**
8 changes: 8 additions & 0 deletions docker/development/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:8.7.0-alpine
ENV npm_package_engines_vscode=^1.8.1
RUN apk add --update git && \
rm -rf /tmp/* /var/cache/apk/*
VOLUME [ "/app" ]
WORKDIR /app

CMD [ "sh", "./docker/development/build.sh" ]
32 changes: 32 additions & 0 deletions docker/development/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# development

If you want to **build** the project you can do this:

```sh
# First, build the image if not already build.
# This should be a one time command.
docker build -t dev docker/development

# Then run it.
# Note that we're using a volume to have access to the artifact in our host (https://docs.docker.com/engine/admin/volumes/volumes/).
# Once the container is done it will automatically be removed and the artifact will be in your mapped folder.
docker run --rm -it -v <your-host-path-here>:/app dev

# Finally, if you want to clean the stale volumes you can run this.
docker volume rm $(docker volume ls -qf dangling=true)
```

If you want to use `Docker` in order to **develop** you can do this:

```sh
# First, build the image if not already build.
# This should be a one time command.
docker build -t dev docker/development

# Then run it.
# Note that we're using a volume to have access to the artifact in our host (https://docs.docker.com/engine/admin/volumes/volumes/).
docker run -it -v <your-host-path-here>:/app dev sh

# Finally, if you want to clean the stale volumes you can run this.
docker volume rm $(docker volume ls -qf dangling=true)
```
3 changes: 3 additions & 0 deletions docker/development/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
. docker/development/install.sh
npm run build
3 changes: 3 additions & 0 deletions docker/development/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
npm i
node node_modules/vscode/bin/install
9 changes: 9 additions & 0 deletions docker/remote-builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:8.7.0-alpine
ENV npm_package_engines_vscode=^1.8.1
RUN apk add --update git && \
rm -rf /tmp/* /var/cache/apk/*
RUN git clone https://github.com/vscode-icons/vscode-icons.git app
VOLUME [ "/app-out" ]
WORKDIR /app
COPY build.sh .
CMD [ "sh", "./build.sh" ]
25 changes: 25 additions & 0 deletions docker/remote-builder/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# remote-builder

The purpose of this image is to be run and get the artifact from building the extension.

Note that the repo will be cloned directly from Github so it will be working always with the latest published version.

This image was originally created to make it easier to consume the latest version of `icon.json` file in order to build the amazing [github-vscode-icons extension](https://github.com/dderevjanik/github-vscode-icons) by [@dderevjanik](https://github.com/dderevjanik).

## How to use it

Assuming you're in the root folder:

```sh
# First, build the image if not already build.
# This should be a one time command.
docker build -t vsi docker/remote-builder

# Then run it.
# Note that we're using a volume to have access to the artifact in our host (https://docs.docker.com/engine/admin/volumes/volumes/).
# Once the container is done it will automatically be removed and the artifact will be in your mapped folder.
docker run --rm -it -v <your-host-path-here>:/app-out vsi

# Finally, if you want to clean the stale volumes you can run this.
docker volume rm $(docker volume ls -qf dangling=true)
```
6 changes: 6 additions & 0 deletions docker/remote-builder/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
git pull
npm i
node node_modules/vscode/bin/install
npm run build
cp -R out/src/* ../app-out