Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
c591b584
Unverified
Commit
c591b584
authored
Mar 02, 2023
by
mergify[bot]
Committed by
GitHub
Mar 02, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5018 from ethereum-optimism/jg/multi_arch_images
Multi architecture docker images
parents
34ce8dad
1f554526
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
66 additions
and
42 deletions
+66
-42
config.yml
.circleci/config.yml
+45
-33
Dockerfile
op-batcher/Dockerfile
+6
-2
Makefile
op-batcher/Makefile
+1
-1
Dockerfile
op-node/Dockerfile
+6
-2
Makefile
op-node/Makefile
+1
-1
Dockerfile
op-proposer/Dockerfile
+6
-2
Makefile
op-proposer/Makefile
+1
-1
No files found.
.circleci/config.yml
View file @
c591b584
...
...
@@ -147,6 +147,8 @@ jobs:
-
"
."
docker-publish
:
environment
:
DOCKER_BUILDKIT
:
1
parameters
:
docker_name
:
description
:
Docker image name
...
...
@@ -154,6 +156,13 @@ jobs:
docker_tags
:
description
:
Docker image tags as csv
type
:
string
docker_file
:
description
:
Path to Dockerfile
type
:
string
docker_context
:
description
:
Docker build context
type
:
string
default
:
"
."
registry
:
description
:
Docker registry
type
:
string
...
...
@@ -162,17 +171,14 @@ jobs:
description
:
Docker repo
type
:
string
default
:
"
oplabs-tools-artifacts/images"
platforms
:
description
:
Platforms to build for
type
:
string
default
:
"
linux/amd64"
machine
:
image
:
ubuntu-2204:2022.07.1
resource_class
:
xlarge
steps
:
-
attach_workspace
:
at
:
/tmp/docker_images
-
run
:
name
:
Docker load
command
:
|
DOCKER_LABELS=$(echo -ne <<parameters.docker_tags>> | sed "s/,/\n/g" | sed "s/[^a-zA-Z0-9\n]/-/g")
echo -ne $DOCKER_LABELS | tr ' ' '\n' | xargs -I {} docker load -i /tmp/docker_images/<<parameters.docker_name>>_{}.tar
-
gcp-oidc-authenticate
# Below is CircleCI recommended way of specifying nameservers on an Ubuntu box:
# https://support.circleci.com/hc/en-us/articles/7323511028251-How-to-set-custom-DNS-on-Ubuntu-based-images-using-netplan
...
...
@@ -181,13 +187,19 @@ jobs:
-
run
:
sudo sed -i "s/addresses:/ addresses":" [8.8.8.8, 8.8.4.4] /g" /etc/netplan/50-cloud-init.yaml
-
run
:
cat /etc/netplan/50-cloud-init.yaml
-
run
:
sudo netplan apply
-
checkout
-
run
:
name
:
Publish
name
:
Build &
Publish
command
:
|
gcloud auth configure-docker <<parameters.registry>>
IMAGE_BASE="<<parameters.registry>>/<<parameters.repo>>/<<parameters.docker_name>>"
DOCKER_TAGS=$(echo -ne <<parameters.docker_tags>> | sed "s/,/\n/g" | sed "s/[^a-zA-Z0-9\n]/-/g" | sed -e "s|^|${IMAGE_BASE}:|")
echo -ne $DOCKER_TAGS | tr ' ' '\n' | xargs -L1 docker push
DOCKER_TAGS=$(echo -ne <<parameters.docker_tags>> | sed "s/,/\n/g" | sed "s/[^a-zA-Z0-9\n]/-/g" | sed -e "s|^|-t ${IMAGE_BASE}:|")
docker context create buildx-build
docker buildx create --use buildx-build
docker buildx build --platform=<<parameters.platforms>> --push \
$(echo -ne $DOCKER_TAGS | tr '\n' ' ') \
-f <<parameters.docker_file>> \
<<parameters.docker_context>>
docker-release
:
environment
:
...
...
@@ -213,6 +225,10 @@ jobs:
description
:
Docker repo
type
:
string
default
:
"
oplabs-tools-artifacts/images"
platforms
:
description
:
Platforms to build for
type
:
string
default
:
"
linux/amd64"
machine
:
image
:
ubuntu-2204:2022.07.1
resource_class
:
xlarge
...
...
@@ -220,26 +236,21 @@ jobs:
-
gcp-cli/install
-
gcp-oidc-authenticate
-
checkout
-
run
:
name
:
Build
command
:
|
IMAGE_BASE="<<parameters.registry>>/<<parameters.repo>>/<<parameters.docker_name>>"
DOCKER_TAGS=$(echo -ne <<parameters.docker_tags>> | sed "s/,/\n/g" | sed "s/[^a-zA-Z0-9\n]/-/g" | sed -e "s|^|-t ${IMAGE_BASE}:|")
docker build \
$(echo -ne $DOCKER_TAGS | tr '\n' ' ') \
-f <<parameters.docker_file>> \
--build-arg VERSION=$CIRCLE_TAG \
<<parameters.docker_context>>
-
run
:
name
:
Configure Docker
command
:
|
gcloud auth configure-docker <<parameters.registry>>
-
run
:
name
:
Publish
name
:
Build &
Publish
command
:
|
IMAGE_BASE="<<parameters.registry>>/<<parameters.repo>>/<<parameters.docker_name>>"
DOCKER_TAGS=$(echo -ne <<parameters.docker_tags>> | sed "s/,/\n/g" | sed "s/[^a-zA-Z0-9\n]/-/g" | sed -e "s|^|${IMAGE_BASE}:|")
echo -ne $DOCKER_TAGS | tr ' ' '\n' | xargs -L1 docker push
DOCKER_TAGS=$(echo -ne <<parameters.docker_tags>> | sed "s/,/\n/g" | sed "s/[^a-zA-Z0-9\n]/-/g" | sed -e "s|^|-t ${IMAGE_BASE}:|")
docker context create buildx-build
docker buildx create --use buildx-build
docker buildx build --platform=<<parameters.platforms>> --push \
$(echo -ne $DOCKER_TAGS | tr '\n' ' ') \
-f <<parameters.docker_file>> \
<<parameters.docker_context>>
-
run
:
name
:
Tag
command
:
|
...
...
@@ -1062,11 +1073,11 @@ workflows:
-
docker-publish
:
name
:
op-node-docker-publish
docker_name
:
op-node
docker_file
:
op-node/Dockerfile
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
context
:
-
oplabs-gcr
requires
:
-
op-node-docker-build
platforms
:
"
linux/amd64,linux/arm64"
-
docker-build
:
name
:
op-batcher-docker-build
docker_file
:
op-batcher/Dockerfile
...
...
@@ -1075,12 +1086,12 @@ workflows:
docker_context
:
.
-
docker-publish
:
name
:
op-batcher-docker-publish
docker_file
:
op-batcher/Dockerfile
docker_name
:
op-batcher
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
context
:
-
oplabs-gcr
requires
:
-
op-batcher-docker-build
platforms
:
"
linux/amd64,linux/arm64"
-
docker-build
:
name
:
op-proposer-docker-build
docker_file
:
op-proposer/Dockerfile
...
...
@@ -1089,12 +1100,12 @@ workflows:
docker_context
:
.
-
docker-publish
:
name
:
op-proposer-docker-publish
docker_file
:
op-proposer/Dockerfile
docker_name
:
op-proposer
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
context
:
-
oplabs-gcr
requires
:
-
op-proposer-docker-build
platforms
:
"
linux/amd64,linux/arm64"
-
docker-build
:
name
:
op-heartbeat-docker-build
docker_file
:
op-heartbeat/Dockerfile
...
...
@@ -1103,12 +1114,11 @@ workflows:
docker_context
:
.
-
docker-publish
:
name
:
op-heartbeat-docker-publish
docker_file
:
op-heartbeat/Dockerfile
docker_name
:
op-heartbeat
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
context
:
-
oplabs-gcr
requires
:
-
op-heartbeat-docker-build
-
docker-build
:
name
:
indexer-docker-build
docker_file
:
indexer/Dockerfile
...
...
@@ -1117,12 +1127,11 @@ workflows:
docker_context
:
.
-
docker-publish
:
name
:
indexer-docker-publish
docker_file
:
indexer/Dockerfile
docker_name
:
indexer
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
context
:
-
oplabs-gcr
requires
:
-
indexer-docker-build
-
hive-test
:
name
:
hive-test-rpc
version
:
<<pipeline.git.revision>>
...
...
@@ -1167,6 +1176,7 @@ workflows:
docker_name
:
op-node
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
docker_context
:
.
platforms
:
"
linux/amd64,linux/arm64"
context
:
-
oplabs-gcr-release
requires
:
...
...
@@ -1182,6 +1192,7 @@ workflows:
docker_name
:
op-batcher
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
docker_context
:
.
platforms
:
"
linux/amd64,linux/arm64"
context
:
-
oplabs-gcr-release
requires
:
...
...
@@ -1197,6 +1208,7 @@ workflows:
docker_name
:
op-proposer
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
docker_context
:
.
platforms
:
"
linux/amd64,linux/arm64"
context
:
-
oplabs-gcr-release
requires
:
...
...
op-batcher/Dockerfile
View file @
c591b584
FROM
golang:1.18.0-alpine3.15 as builder
FROM
--platform=$BUILDPLATFORM
golang:1.18.0-alpine3.15 as builder
ARG
VERSION=v0.0.0
...
...
@@ -17,7 +17,11 @@ COPY ./.git /app/.git
WORKDIR
/app/op-batcher
RUN
make op-batcher
VERSION
=
"
$VERSION
"
RUN
go mod download
ARG
TARGETOS TARGETARCH
RUN
make op-batcher
VERSION
=
"
$VERSION
"
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
FROM
alpine:3.15
...
...
op-batcher/Makefile
View file @
c591b584
...
...
@@ -8,7 +8,7 @@ LDFLAGSSTRING +=-X main.Version=$(VERSION)
LDFLAGS
:=
-ldflags
"
$(LDFLAGSSTRING)
"
op-batcher
:
env
GO111MODULE
=
on go build
-v
$(LDFLAGS)
-o
./bin/op-batcher ./cmd
env
GO111MODULE
=
on
GOOS
=
$(TARGETOS)
GOARCH
=
$(TARGETARCH)
go build
-v
$(LDFLAGS)
-o
./bin/op-batcher ./cmd
clean
:
rm
bin/op-batcher
...
...
op-node/Dockerfile
View file @
c591b584
FROM
golang:1.18.0-alpine3.15 as builder
FROM
--platform=$BUILDPLATFORM
golang:1.18.0-alpine3.15 as builder
ARG
VERSION=v0.0.0
...
...
@@ -15,7 +15,11 @@ COPY ./.git /app/.git
WORKDIR
/app/op-node
RUN
make op-node
VERSION
=
"
$VERSION
"
RUN
go mod download
ARG
TARGETOS TARGETARCH
RUN
make op-node
VERSION
=
"
$VERSION
"
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
FROM
alpine:3.15
...
...
op-node/Makefile
View file @
c591b584
...
...
@@ -9,7 +9,7 @@ LDFLAGSSTRING +=-X github.com/ethereum-optimism/optimism/op-node/version.Meta=$(
LDFLAGS
:=
-ldflags
"
$(LDFLAGSSTRING)
"
op-node
:
env
GO111MODULE
=
on go build
-v
$(LDFLAGS)
-o
./bin/op-node ./cmd/main.go
env
GO111MODULE
=
on
GOOS
=
$(TARGETOS)
GOARCH
=
$(TARGETARCH)
go build
-v
$(LDFLAGS)
-o
./bin/op-node ./cmd/main.go
clean
:
rm
bin/op-node
...
...
op-proposer/Dockerfile
View file @
c591b584
FROM
golang:1.18.0-alpine3.15 as builder
FROM
--platform=$BUILDPLATFORM
golang:1.18.0-alpine3.15 as builder
ARG
VERSION=v0.0.0
...
...
@@ -16,7 +16,11 @@ COPY ./.git /app/.git
WORKDIR
/app/op-proposer
RUN
make op-proposer
VERSION
=
"
$VERSION
"
RUN
go mod download
ARG
TARGETOS TARGETARCH
RUN
make op-proposer
VERSION
=
"
$VERSION
"
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
FROM
alpine:3.15
...
...
op-proposer/Makefile
View file @
c591b584
...
...
@@ -8,7 +8,7 @@ LDFLAGSSTRING +=-X main.Version=$(VERSION)
LDFLAGS
:=
-ldflags
"
$(LDFLAGSSTRING)
"
op-proposer
:
env
GO111MODULE
=
on go build
-v
$(LDFLAGS)
-o
./bin/op-proposer ./cmd
env
GO111MODULE
=
on
GOOS
=
$(TARGETOS)
GOARCH
=
$(TARGETARCH)
go build
-v
$(LDFLAGS)
-o
./bin/op-proposer ./cmd
clean
:
rm
bin/op-proposer
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment