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

Commit ead90c0

Browse files
author
Nyah Check
committed
docker: Fixed issues with docker file, multi stage container build successful.
1 parent f8a7e62 commit ead90c0

File tree

2 files changed

+12
-21
lines changed

2 files changed

+12
-21
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# Compiled binaries
1616
ytd
17-
youtube-dld
17+
youtube-dl
1818

1919
# Folders
2020
_obj

Dockerfile

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ RUN mkdir -p /go/src/github.com/Ch3ck/youtube-dl/
55
WORKDIR /go/src/github.com/Ch3ck/youtube-dl
66

77
COPY vendor vendor
8-
COPY ytd.go .
8+
COPY api api
9+
COPY Makefile Makefile
10+
COPY ytd.go .
911

1012
RUN gofmt -l -d $(find . -type f -name '*.go' -not -path "./vendor/*") \
1113
&& CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o ytd .
@@ -18,24 +20,13 @@ MAINTAINER Nyah Check <check.nyah@gmail.com>
1820
ENV PATH /go/bin:/usr/local/go/bin:$PATH
1921
ENV GOPATH /go
2022

21-
RUN apk add --no-cache add ca-certificates
23+
RUN apk add --no-cache \
24+
ca-certificates
2225

2326
WORKDIR /root/
24-
COPY --from=0 /go/src/github.com/Ch3ck/ytd .
25-
26-
RUN set -x \
27-
&& apk add --no-cache --virtual .build-deps \
28-
go \
29-
git \
30-
gcc \
31-
libc-dev \
32-
libgcc \
33-
ffmpeg \
34-
&& cd /go/src/github.com/Ch3ck/ytd \
35-
&& go build -o /usr/bin/ytd . \
36-
&& apk del .build-deps \
37-
&& rm -rf /go \
38-
&& echo "Build complete."
39-
40-
41-
CMD [ "./ytd" ]
27+
COPY --from=0 /go/src/github.com/Ch3ck/youtube-dl .
28+
29+
RUN echo "Image build complete."
30+
31+
32+
ENTRYPOINT [ "youtube-dl" ]

0 commit comments

Comments
 (0)