The Wayback Machine - https://web.archive.org/web/20230316154418/https://github.com/github/linguist/commit/8083cb5a89cee2d99f5a988f165994d0243f0d1e
Skip to content
Permalink
Browse files
Add Dockerfile (#4687)
* added docker image

* added breakdown example to README.md, removed useless packages from docker, fix .dockerignore

* delete useless libs after build

* remove cmake after build

* Add test for dockerfile

* Checkout code

Co-authored-by: Zaytsev Dmitriy <zaytsev_dmitriy@edadeal.ru>
Co-authored-by: Colin Seymour <colin@github.com>
  • Loading branch information
3 people committed Sep 8, 2020
1 parent 61fc3f0 commit 8083cb5
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
@@ -0,0 +1,2 @@
.git/
test/
@@ -27,3 +27,16 @@ jobs:
run: bundle exec rake
- name: Check Licenses
run: bundle exec licensed status -c vendor/licenses/config.yml
dockerfile:
name: Test Dockerfile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build container
run: docker build -t linguist .
- name: Analyse current directory
run: docker run --rm -v $(pwd):$(pwd) -w $(pwd) -t linguist > output
- name: Confirm analysis
run: |
cat output
grep Ruby output
@@ -0,0 +1,12 @@
FROM ruby:alpine

RUN apk --update add --virtual build_deps \
build-base \
libc-dev \
linux-headers \
cmake \
&& apk --no-cache add icu-dev libressl-dev \
&& gem install github-linguist \
&& apk del build_deps build-base libc-dev linux-headers cmake

CMD ["github-linguist"]
@@ -137,6 +137,36 @@ grammars.yml: 884 lines (884 sloc)
language: YAML
```

#### Docker

If you have Docker installed you can build an image and run Linguist within a container:

```console
$ docker build -t linguist .
$ docker run --rm -v $(pwd):$(pwd) -w $(pwd) -t linguist
68.57% Ruby
22.90% C
6.93% Go
1.21% Lex
0.39% Shell
$ docker run --rm -v $(pwd):$(pwd) -w $(pwd) -t linguist github-linguist --breakdown
68.57% Ruby
22.90% C
6.93% Go
1.21% Lex
0.39% Shell

Ruby:
Gemfile
Rakefile
bin/git-linguist
bin/github-linguist
ext/linguist/extconf.rb
github-linguist.gemspec
lib/linguist.rb
```

## Troubleshooting

### My repository is detected as the wrong language

0 comments on commit 8083cb5

Please sign in to comment.