-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docker] dual-publish setcap; default raise limits #1745
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,29 @@ | ||
{ | ||
"images": { | ||
"m3dbnode": { | ||
"dockerfile": "docker/m3dbnode/Dockerfile" | ||
"m3aggregator": { | ||
"dockerfile": "docker/m3aggregator/Dockerfile", | ||
"name": "m3aggregator" | ||
}, | ||
"m3coordinator": { | ||
"dockerfile": "docker/m3coordinator/Dockerfile" | ||
"dockerfile": "docker/m3coordinator/Dockerfile", | ||
"name": "m3coordinator" | ||
}, | ||
"m3query": { | ||
"dockerfile": "docker/m3query/Dockerfile" | ||
"m3dbnode": { | ||
"dockerfile": "docker/m3dbnode/Dockerfile", | ||
"name": "m3dbnode" | ||
}, | ||
"m3dbnode-setcap": { | ||
"dockerfile": "docker/m3dbnode/Dockerfile-setcap", | ||
"name": "m3dbnode", | ||
"tag_suffix": "setcap" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will it add a "-" automatically? i.e. 0.10.2-setcap or will it be 0.10.2setcap ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, in the builder script we have TAG="${TAG}-${TAG_SUFFIX}" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice. |
||
}, | ||
"m3nsch": { | ||
"dockerfile": "docker/m3nsch/Dockerfile" | ||
"dockerfile": "docker/m3nsch/Dockerfile", | ||
"name": "m3nsch" | ||
}, | ||
"m3query": { | ||
"dockerfile": "docker/m3query/Dockerfile", | ||
"name": "m3query" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# stage 1: build | ||
FROM golang:1.12-alpine AS builder | ||
LABEL maintainer="The M3DB Authors <[email protected]>" | ||
|
||
# Install Glide | ||
RUN apk add --update glide git make bash | ||
|
||
# Add source code | ||
RUN mkdir -p /go/src/github.com/m3db/m3 | ||
ADD . /go/src/github.com/m3db/m3 | ||
|
||
# Build m3dbnode binary | ||
RUN cd /go/src/github.com/m3db/m3/ && \ | ||
git submodule update --init && \ | ||
make m3dbnode-linux-amd64 | ||
|
||
# Stage 2: lightweight "release" | ||
FROM alpine:latest | ||
LABEL maintainer="The M3DB Authors <[email protected]>" | ||
|
||
EXPOSE 2379/tcp 2380/tcp 7201/tcp 7203/tcp 9000-9004/tcp | ||
|
||
COPY --from=builder /go/src/github.com/m3db/m3/src/dbnode/config/m3dbnode-local-etcd.yml /etc/m3dbnode/m3dbnode.yml | ||
COPY --from=builder /go/src/github.com/m3db/m3/bin/m3dbnode \ | ||
/go/src/github.com/m3db/m3/scripts/m3dbnode_bootstrapped.sh \ | ||
/bin/ | ||
|
||
# Use setcap to set +e "effective" and +p "permitted" to adjust the SYS_RESOURCE | ||
# so the process can raise the hard file limit with setrlimit. | ||
RUN apk add --no-cache curl jq libcap && \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need curl and jq? I'm fine to leave it out and add on login (i.e. just apk add when you start a shell session), or if you feel we should (which I'm fine with too), should we putting it in the other base image too? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We only need it for M3DB for the |
||
setcap cap_sys_resource=+ep /bin/m3dbnode | ||
|
||
ENTRYPOINT [ "/bin/m3dbnode" ] | ||
CMD [ "-f", "/etc/m3dbnode/m3dbnode.yml" ] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we also add
m3aggregator
to this btw? Noticed we don't have an image (can do this in followup I suppose though).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do