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
MYST-413 Fix broken Alpine image #197
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6f8740c
Fix readelf instruction
Waldz 578ac86
Pack Alpine container with glibc
Waldz ba8b8f3
Compile on Alpine g++ libraries
Waldz a5a71cb
Alpine container for client
Waldz 2e90be7
Down download Glide for Darwin (on Unix)
Waldz 732ef7c
Push several tags of Docker images
Waldz 2b37724
Push Docker containers for client
Waldz 899963b
Removed network injection
Waldz 60d3e91
Fix readelf instruction
Waldz facd1de
Fix docker ignored files
Waldz File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
build/server/ca.* | ||
build/server/server.* | ||
build/server/tc.key | ||
build/server/*.sock | ||
build/client/*.sock | ||
build/ | ||
.git/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM golang:1.9.2-alpine AS builder | ||
|
||
# Install packages | ||
RUN apk add --update --no-cache bash g++ make \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
# Compile application | ||
WORKDIR /go/src/github.com/mysterium/node | ||
ADD . . | ||
RUN bin/client_build | ||
|
||
|
||
|
||
FROM alpine:3.6 | ||
MAINTAINER Valdas Petrulis <petrulis.valdas@gmail.com> | ||
|
||
# Install packages | ||
RUN apk add --update --no-cache bash iptables ca-certificates openvpn \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
# Install application | ||
COPY bin/client_docker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh | ||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] | ||
|
||
COPY bin/client_package/config /etc/mysterium-node | ||
COPY --from=builder /go/src/github.com/mysterium/node/build/client/mysterium_client /usr/bin/mysterium_client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
########################################################################### | ||
# Creates Docker image and uploads it to DockerHub https://hub.docker.com/r/mysteriumnetwork/mysterium-node/ | ||
# | ||
# To create a release, simply execute: | ||
#> bin/client_package_docker version [tag..] | ||
|
||
# Usage example: | ||
#> bin/client_package_docker 0.0.1 | ||
#> bin/client_package_docker 0.0.1 0.0.1-alpine alpine latest | ||
|
||
VERSION=$1 | ||
if [ -z "$VERSION" ]; then | ||
printf "\e[0;31m%s\e[0m\n" "Missing version!" | ||
exit 1 | ||
fi | ||
|
||
DOCKER_IMAGE="mysteriumnetwork/mysterium-client" | ||
|
||
printf "Building Alpine image..\n" \ | ||
&& docker build \ | ||
--file bin/client_docker/alpine/Dockerfile \ | ||
--build-arg PACKAGE_VERSION=$VERSION \ | ||
--tag $DOCKER_IMAGE:$VERSION-alpine \ | ||
. | ||
if [ $? -ne 0 ] ; then | ||
printf "\e[0;31m%s\e[0m\n" "Failed to build Alpine image!" | ||
exit 1 | ||
fi | ||
|
||
shift | ||
while test $# -gt 0; do | ||
DOCKER_TAG=$1 | ||
printf "Publishing version '$DOCKER_TAG' image..\n" \ | ||
&& docker tag $DOCKER_IMAGE:$VERSION-alpine $DOCKER_IMAGE:$DOCKER_TAG \ | ||
&& docker push $DOCKER_IMAGE:$DOCKER_TAG | ||
shift | ||
done | ||
|
||
printf "\e[0;32m%s\e[0m\n" "Docker image building process complete!" | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
########################################################################### | ||
# Creates Docker image and uploads it to DockerHub https://hub.docker.com/r/mysteriumnetwork/mysterium-node/ | ||
# | ||
# To create a release, simply execute: | ||
#> bin/client_package_docker version [tag..] | ||
|
||
# Usage example: | ||
#> bin/client_package_docker_ubuntu 0.0.1 | ||
#> bin/client_package_docker_ubuntu 0.0.1 0.0.1-ubuntu ubuntu | ||
|
||
VERSION=$1 | ||
if [ -z "$VERSION" ]; then | ||
printf "\e[0;31m%s\e[0m\n" "Missing version!" | ||
exit 1 | ||
fi | ||
|
||
DOCKER_IMAGE="mysteriumnetwork/mysterium-client" | ||
|
||
printf "Building Ubuntu image..\n" \ | ||
&& docker build \ | ||
--file bin/client_docker/ubuntu/Dockerfile \ | ||
--build-arg PACKAGE_VERSION=$VERSION \ | ||
--tag $DOCKER_IMAGE:$VERSION-ubuntu \ | ||
. | ||
if [ $? -ne 0 ] ; then | ||
printf "\e[0;31m%s\e[0m\n" "Failed to build Ubuntu image!" | ||
exit 1 | ||
fi | ||
|
||
shift | ||
while test $# -gt 0; do | ||
DOCKER_TAG=$1 | ||
printf "Publishing version '$DOCKER_TAG' image..\n" \ | ||
&& docker tag $DOCKER_IMAGE:$VERSION-ubuntu $DOCKER_IMAGE:$DOCKER_TAG \ | ||
&& docker push $DOCKER_IMAGE:$DOCKER_TAG | ||
shift | ||
done | ||
|
||
printf "\e[0;32m%s\e[0m\n" "Docker image building process complete!" | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
FROM golang:1.9.2-alpine AS builder | ||
|
||
# Install packages | ||
RUN apk add --update bash \ | ||
RUN apk add --update --no-cache bash g++ make \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
# Compile application | ||
WORKDIR /go/src/github.com/mysterium/node | ||
ADD . . | ||
RUN GOOS=linux GOARCH=amd64 bin/server_build | ||
RUN bin/server_build | ||
|
||
|
||
|
||
FROM alpine:3.6 | ||
MAINTAINER Valdas Petrulis <petrulis.valdas@gmail.com> | ||
|
||
# Install packages | ||
RUN apk update \ | ||
&& apk add --no-cache iptables ca-certificates openvpn \ | ||
RUN apk add --update --no-cache bash iptables ca-certificates openvpn \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
# Install application | ||
COPY --from=builder /go/src/github.com/mysterium/node/build/server/mysterium_server /usr/bin/mysterium_server | ||
COPY bin/server_package/config /etc/mysterium-node | ||
|
||
COPY bin/server_docker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh | ||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] | ||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] | ||
|
||
COPY bin/server_package/config /etc/mysterium-node | ||
COPY --from=builder /go/src/github.com/mysterium/node/build/server/mysterium_server /usr/bin/mysterium_server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ set -e | |
while true; | ||
echo "Sleeping.."; | ||
do sleep 5; | ||
done | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
########################################################################### | ||
# Creates Docker image and uploads it to DockerHub https://hub.docker.com/r/mysteriumnetwork/mysterium-node/ | ||
# | ||
# To create a release, simply execute: | ||
#> bin/server_package_docker version [tag..] | ||
|
||
# Usage example: | ||
#> bin/server_package_docker_ubuntu 0.0.1 | ||
#> bin/server_package_docker_ubuntu 0.0.1 0.0.1-ubuntu ubuntu | ||
|
||
VERSION=$1 | ||
if [ -z "$VERSION" ]; then | ||
printf "\e[0;31m%s\e[0m\n" "Missing version!" | ||
exit 1 | ||
fi | ||
|
||
DOCKER_IMAGE="mysteriumnetwork/mysterium-node" | ||
|
||
printf "Building Ubuntu image..\n" \ | ||
&& docker build \ | ||
--file bin/server_docker/ubuntu/Dockerfile \ | ||
--build-arg PACKAGE_VERSION=$VERSION \ | ||
--tag $DOCKER_IMAGE:$VERSION-ubuntu \ | ||
. | ||
if [ $? -ne 0 ] ; then | ||
printf "\e[0;31m%s\e[0m\n" "Failed to build Ubuntu image!" | ||
exit 1 | ||
fi | ||
|
||
shift | ||
while test $# -gt 0; do | ||
DOCKER_TAG=$1 | ||
printf "Publishing version '$DOCKER_TAG' image..\n" \ | ||
&& docker tag $DOCKER_IMAGE:$VERSION-ubuntu $DOCKER_IMAGE:$DOCKER_TAG \ | ||
&& docker push $DOCKER_IMAGE:$DOCKER_TAG | ||
shift | ||
done | ||
|
||
printf "\e[0;32m%s\e[0m\n" "Docker image building process complete!" | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
From docker perspective it's not very efficient to put executable AND it's args into entry point, as it will be very hard to override params later. It should be like this:
ENTRYPOINT ["your exec and args which must be always present and never change"]
CMD["default additional args which can be customized when using docker run style"]
those could be tequila.port , address , discovery address etc.
Do we really even need docker-entrypoint.sh ? it hides important stuff, also uses env vars internally and it's hard to track what is going on
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.
Good ideas, will depreciate Docker environments variables in upcoming PRs