Skip to content
This repository has been archived by the owner on Oct 6, 2024. It is now read-only.

Commit

Permalink
Update docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyah Check authored and Nyah committed Apr 9, 2020
1 parent 1dd26b9 commit fe14ba2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Dockerfile
**.md
.git
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ ENV GO111MODULE=on
WORKDIR /app
RUN echo "Build container"
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o ./youtube-dl download.go main.go
RUN CGO_ENABLED=0 GOOS=linux go build -o /youtube-dl .


# Runtime container
FROM scratch
RUN echo "Runtime container"
COPY --from=go-base /app/youtube-dl /youtube-dl
COPY --from=go-base /youtube-dl /youtube-dl
ENTRYPOINT ["/youtube-dl"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Flags:
### Example

```console
$ ./youtube-dl -format mp3 https://www.youtube.com/watch?v=jOWsu8ePrbE
$ ./youtube-dl -format mp3 -id https://www.youtube.com/watch?v=lWEbEtr_Vng
```

## Roadmap
Expand Down
6 changes: 3 additions & 3 deletions download_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
var tables = []struct {
url, id string // input
}{
{"https://www.youtube.com/watch?v=HpNluHOAJFA", "HpNluHOAJFA"},
{"https://www.youtube.com/watch?v=jOWsu8ePrbE", "jOWsu8ePrbE"},
{"https://www.youtube.com/watch?v=lWEbEtr_Vng", "lWEbEtr_Vng"},
{"https://www.youtube.com/watch?v=ALWmcO8S-dc", "ALWmcO8S-dc"},
{"", ""},
{"https://www.facebook.com/mark/videos?v=RDHpNluHOAJFA", ""},
{"https://www.youtube.com/watch?v=lWEbEtr_Vng", "lWEbEtr_Vng"},
{"https://www.youtube.com/watch?v=ALWmcO8S-dc", "ALWmcO8S-dc"},
{"https://www.wsj.com/articles/trump-administration-wont-withdraw-from-paris-climate-deal-1505593922", ""},
{"https://vimeo.com/101522071", ""},
}
Expand Down
1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ func parseUrls(urls string) []string {
}

func beginDownload(urls []string) {

if len(urls) < 2 {
if err := decodeVideoStream(urls[0], path, format); err != nil {
logrus.Errorf("Unable to beginDownload: %v", err)
Expand Down

0 comments on commit fe14ba2

Please sign in to comment.