Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Goshimmer_without_tipselection
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
COLLET Ismael
Goshimmer_without_tipselection
Commits
4b4d761b
Unverified
Commit
4b4d761b
authored
5 years ago
by
Wolfgang Welz
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
harden docker image (#290)
parent
1befc3a9
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.dockerignore
+12
-0
12 additions, 0 deletions
.dockerignore
Dockerfile
+28
-17
28 additions, 17 deletions
Dockerfile
docker-compose.yml
+1
-1
1 addition, 1 deletion
docker-compose.yml
with
41 additions
and
18 deletions
.dockerignore
+
12
−
0
View file @
4b4d761b
.git
.gitignore
LICENSE
README.md
CHANGELOG.md
images/
docker-compose.yml
tools/
client/
# Database directory
mainnetdb/
This diff is collapsed.
Click to expand it.
Dockerfile
+
28
−
17
View file @
4b4d761b
# we need to use alpine to build since cgo is required
FROM
golang:1.14-alpine
AS
build
RUN
apk add
--no-cache
git gcc g++
############################
# Build
############################
# golang:1.14.0-buster
FROM
golang@sha256:fc7e7c9c4b0f6d2d5e8611ee73b9d1d3132750108878517bbf988aa772359ae4
AS
build
# Ensure ca-certficates are up to date
RUN
update-ca-certificates
# Set the current Working Directory inside the container
RUN
mkdir
/goshimmer
WORKDIR
/goshimmer
#
Download dependenci
es
COPY
go.mod .
#
Use Go Modul
es
COPY
go.mod .
COPY
go.sum .
ENV
GO111MODULE=on
RUN
go mod download
RUN
go mod verify
# Copy everything from the current directory to the PWD(Present Working Directory) inside the container
COPY
. .
# Build
RUN
CGO_ENABLED
=
1
GOOS
=
linux go build
-o
/go/bin/goshimmer
FROM
alpine:latest
RUN
apk
--no-cache
add ca-certificates
# Build the binary
RUN
CGO_ENABLED
=
0
GOOS
=
linux
GOARCH
=
amd64 go build
\
-ldflags
=
'-w -s -extldflags "-static"'
-a
\
-o
/go/bin/goshimmer
WORKDIR
/app
############################
# Image
############################
# using static nonroot image
# user:group is nonroot:nonroot, uid:gid = 65532:65532
FROM
gcr.io/distroless/static@sha256:23aa732bba4c8618c0d97c26a72a32997363d591807b0d4c31b0bbc8a774bddf
VOLUME
/app
/mainnetdb
VOLUME
/mainnetdb
EXPOSE
14666/tcp
EXPOSE
14626/udp
# Copy the Pre-built binary file from the previous stage
COPY
--from=build /go/bin/goshimmer
.
# Copy the d
ocker
config
COPY
config.json config.json
COPY
--from=build /go/bin/goshimmer
/run/goshimmer
# Copy the d
efault
config
COPY
config.
default.
json config.json
ENTRYPOINT
["
.
/goshimmer"]
ENTRYPOINT
["
/run
/goshimmer"
, "--database.directory=/mainnetdb"
]
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
1
−
1
View file @
4b4d761b
...
...
@@ -11,7 +11,7 @@ services:
container_name
:
iota_goshimmer
restart
:
unless-stopped
volumes
:
-
./mainnetdb:
/app
/mainnetdb:rw
-
./mainnetdb
/
:/mainnetdb
/
:rw
ports
:
-
"
14666:14666/tcp"
-
"
14626:14626/udp"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment