You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "tisonkun (via GitHub)" <gi...@apache.org> on 2023/05/27 12:23:21 UTC

[GitHub] [incubator-kvrocks] tisonkun opened a new pull request, #1477: build: tidy dockerfile

tisonkun opened a new pull request, #1477:
URL: https://github.com/apache/incubator-kvrocks/pull/1477

   Comments inline.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] tisonkun commented on pull request #1477: build: tidy dockerfile

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #1477:
URL: https://github.com/apache/incubator-kvrocks/pull/1477#issuecomment-1565433173

   cc @aleksraiden may you verify this patch also.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] tisonkun commented on a diff in pull request #1477: build: tidy dockerfile

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #1477:
URL: https://github.com/apache/incubator-kvrocks/pull/1477#discussion_r1207934747


##########
Dockerfile:
##########
@@ -19,10 +19,6 @@ FROM alpine:3.16 as build
 
 ARG MORE_BUILD_ARGS
 
-# workaround tzdata install hanging
-ENV TZ=Etc/UTC

Review Comment:
   After switching to Alpine, we don't need this trick.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] tisonkun commented on a diff in pull request #1477: build: tidy dockerfile

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #1477:
URL: https://github.com/apache/incubator-kvrocks/pull/1477#discussion_r1207935374


##########
Dockerfile:
##########
@@ -31,36 +27,23 @@ RUN ./x.py build -DENABLE_OPENSSL=ON -DPORTABLE=ON -DCMAKE_BUILD_TYPE=Release -j
 
 FROM alpine:3.16
 
-ENV TZ=Etc/UTC
-RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
-
 RUN apk upgrade && apk add libexecinfo
-
-WORKDIR /kvrocks
-
 RUN mkdir /var/run/kvrocks && mkdir /var/lib/kvrocks
-
 RUN addgroup -S kvrocks && adduser -D -H -S -G kvrocks kvrocks
-
 RUN chown kvrocks:kvrocks /var/run/kvrocks && chown kvrocks:kvrocks /var/lib/kvrocks
 
 USER kvrocks
-
-COPY --from=build /kvrocks/build/kvrocks ./bin/
-COPY --from=build /usr/bin/redis-cli ./bin/
-
-HEALTHCHECK --interval=10s --timeout=1s --start-period=30s --retries=3 CMD ./bin/redis-cli -p 6666 PING | grep -E '(PONG|NOAUTH)' || exit 1
-
-ENV PATH="$PATH:/kvrocks/bin"
-
 VOLUME /var/lib/kvrocks
 
-RUN chown kvrocks:kvrocks /var/lib/kvrocks
+COPY --from=build /kvrocks/build/kvrocks /bin/

Review Comment:
   Simplify a bit layout:
   
   ```
   /bin/kvrocks
   /bin/redis-cli
   /kvrocks/<LICENSE/NOTICE>
   /var/...
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] tisonkun commented on a diff in pull request #1477: build: tidy dockerfile

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #1477:
URL: https://github.com/apache/incubator-kvrocks/pull/1477#discussion_r1207934352


##########
.dockerignore:
##########
@@ -1,5 +1,54 @@
-**/.git
-**/.gitignore
-**/.github
-**/tests
-Dockerfile
+/.git
+/.gitignore
+/.github
+/tests
+/Dockerfile
+
+# Prerequisites
+*.d
+
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+*.dll
+
+# Fortran module files
+*.mod
+*.smod
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+# Executables
+*.exe
+*.out
+*.app
+
+*.pyc
+*.swp
+*.swo
+.DS_Store
+version.h
+
+.idea
+.vscode
+.cache
+
+compactdb
+testdb
+
+build

Review Comment:
   Add `.gitignore` content. Avoid build content conflict issues.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] tisonkun merged pull request #1477: build: tidy dockerfile

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun merged PR #1477:
URL: https://github.com/apache/incubator-kvrocks/pull/1477


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] tisonkun commented on pull request #1477: build: tidy dockerfile

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #1477:
URL: https://github.com/apache/incubator-kvrocks/pull/1477#issuecomment-1565743133

   Merging...
   
   Thanks for your review!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] tisonkun commented on a diff in pull request #1477: build: tidy dockerfile

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #1477:
URL: https://github.com/apache/incubator-kvrocks/pull/1477#discussion_r1207936279


##########
Dockerfile:
##########
@@ -31,36 +27,23 @@ RUN ./x.py build -DENABLE_OPENSSL=ON -DPORTABLE=ON -DCMAKE_BUILD_TYPE=Release -j
 
 FROM alpine:3.16
 
-ENV TZ=Etc/UTC
-RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
-
 RUN apk upgrade && apk add libexecinfo
-
-WORKDIR /kvrocks
-
 RUN mkdir /var/run/kvrocks && mkdir /var/lib/kvrocks
-
 RUN addgroup -S kvrocks && adduser -D -H -S -G kvrocks kvrocks
-
 RUN chown kvrocks:kvrocks /var/run/kvrocks && chown kvrocks:kvrocks /var/lib/kvrocks
 
 USER kvrocks
-
-COPY --from=build /kvrocks/build/kvrocks ./bin/
-COPY --from=build /usr/bin/redis-cli ./bin/
-
-HEALTHCHECK --interval=10s --timeout=1s --start-period=30s --retries=3 CMD ./bin/redis-cli -p 6666 PING | grep -E '(PONG|NOAUTH)' || exit 1
-
-ENV PATH="$PATH:/kvrocks/bin"
-
 VOLUME /var/lib/kvrocks
 
-RUN chown kvrocks:kvrocks /var/lib/kvrocks

Review Comment:
   Duplicated above.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] aleksraiden commented on pull request #1477: build: tidy dockerfile

Posted by "aleksraiden (via GitHub)" <gi...@apache.org>.
aleksraiden commented on PR #1477:
URL: https://github.com/apache/incubator-kvrocks/pull/1477#issuecomment-1565644160

   > cc @aleksraiden may you verify this patch also.
   
   Awesome! LGTM


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org