Skip to content

Commit

Permalink
chore: docker
Browse files Browse the repository at this point in the history
  • Loading branch information
thestuti committed Jun 28, 2023
1 parent cbb96bb commit d3f54dd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Expand Up @@ -17,7 +17,8 @@ FROM alpine:latest
WORKDIR /app

COPY --from=builder /app/extract-images /app/extract-images
COPY --from=builder /app/urls.txt /app/urls.txt

RUN apk --no-cache add ca-certificates

ENTRYPOINT ["/app/extract-images"]
ENTRYPOINT ["/app/extract-images"]
7 changes: 7 additions & 0 deletions run.sh
@@ -0,0 +1,7 @@
#!/bin/bash

drive=$(echo $1 | cut -d ":" -f 1)

path=$(echo $1 | sed "s/.*://; s/\\\/\//g")

docker run -v ${PWD}/${drive}:${path} extract-images -l ${path}
4 changes: 3 additions & 1 deletion src/main.go
Expand Up @@ -143,10 +143,12 @@ func main() {
}

if *fileFlag == "" {
if *urlFlag == "" || *locationFlag == "" {
if *urlFlag == "" {
fmt.Print("Enter the URL of the webpage: ")
fmt.Scanln(urlFlag)

}
if *locationFlag == "" {
fmt.Print("Enter the location to save the extracted images: ")
fmt.Scanln(locationFlag)
}
Expand Down
2 changes: 1 addition & 1 deletion urls.txt
@@ -1,2 +1,2 @@
https://go.dev/
https://git-scm.com/
https://git-scm.com/c

0 comments on commit d3f54dd

Please sign in to comment.