Skip to content

Commit

Permalink
💄 Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno committed Mar 5, 2021
1 parent c0b8add commit c0e0770
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 17 deletions.
6 changes: 5 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ out/
npm-debug.log
!src/test/**/node_modules
package-lock.json
Dockerfile
Dockerfile
.gitignore
LICENSE
README.md
ThirdPartyNotices.txt
4 changes: 3 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ yarn.lock
.travis.yml
.vscode/
out/**/*.d.ts
!out/api.d.ts
!out/api.d.ts
.dockerignore
Dockerfile
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM node:12-alpine
VOLUME /usr/share/vsce
WORKDIR /src
WORKDIR /opt/vsce
COPY package.json .
COPY yarn.lock .
RUN yarn
COPY . .
RUN yarn compile
WORKDIR /usr/share/vsce
ENTRYPOINT ["/src/out/vsce"]
VOLUME /workspace
WORKDIR /workspace
ENTRYPOINT ["/opt/vsce/out/vsce"]
38 changes: 27 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,46 @@

## Requirements

- [Node.js](https://nodejs.org/en/) at least `8.x.x` or
- [Docker](https://docker.com/)
- [Node.js](https://nodejs.org/en/) at least `8.x.x`

## Usage
Or simply [Docker](#via-docker).

`vsce` is meant to be mainly used as a command line tool. It can also be used a library since it exposes a small [API](https://github.com/microsoft/vscode-vsce/blob/master/src/api.ts).
## Usage

> **Warning:** When using vsce as a library be sure to sanitize any user input used in API calls, as a security measurement.
Install vsce globally:

### via Node.js
```sh
npm install -g vsce
```

To install vsce globally, you can use the following command:
Verify the installation:

```sh
npm install -g vsce
vsce --version
```

### via Docker
`vsce` is meant to be mainly used as a command line tool. It can also be used a library since it exposes a small [API](https://github.com/microsoft/vscode-vsce/blob/master/src/api.ts). When using vsce as a library be sure to sanitize any user input used in API calls, as a security measurement.

To build your own Docker image, first clone this repository and then run the following commands:
## Usage via Docker

You can also build a container for running vsce:

```sh
git clone https://github.com/microsoft/vscode-vsce
cd vscode-vsce
docker build -t vsce .
docker run -it -v /host/path/extension:/usr/share/vsce vsce # change /host/path/extension to your actual vsce extension path
```

Validate the container:

```sh
docker run -it vsce --version
```

Publish your local extension:

```sh
docker run -it -v $(pwd):/workspace vsce publish
```

## Development
Expand Down

0 comments on commit c0e0770

Please sign in to comment.