mirror of
https://github.com/docker/build-push-action.git
synced 2025-06-13 14:47:13 +02:00
Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
b32b51a8ed | |||
594bf46f0f | |||
fd37bd55af | |||
e6478a2405 | |||
78785bddff | |||
128779fed7 | |||
7e094594be | |||
32ee877a58 | |||
d1a4129c41 | |||
49c623eaf8 | |||
bcc9f4afe7 | |||
da5b6c75b9 | |||
11be14d908 | |||
f5a8591a7f | |||
8796455d32 | |||
750f367828 |
3
.github/workflows/.e2e-run.yml
vendored
3
.github/workflows/.e2e-run.yml
vendored
@ -65,10 +65,11 @@ jobs:
|
||||
if: inputs.type == 'local'
|
||||
run: |
|
||||
if [ ! -e /etc/docker/daemon.json ]; then
|
||||
echo '{}' | tee /etc/docker/daemon.json >/dev/null
|
||||
echo '{}' | sudo tee /etc/docker/daemon.json >/dev/null
|
||||
fi
|
||||
DOCKERD_CONFIG=$(jq '.+{"insecure-registries":["http://${{ env.REGISTRY_FQDN }}"]}' /etc/docker/daemon.json)
|
||||
sudo tee /etc/docker/daemon.json <<<"$DOCKERD_CONFIG" >/dev/null
|
||||
cat /etc/docker/daemon.json
|
||||
sudo service docker restart
|
||||
-
|
||||
name: Install ${{ inputs.name }}
|
||||
|
24
README.md
24
README.md
@ -60,18 +60,18 @@ jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
@ -132,18 +132,18 @@ jobs:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
|
4
dist/index.js
generated
vendored
4
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@ -27,7 +27,7 @@
|
||||
"packageManager": "yarn@3.6.3",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.11.1",
|
||||
"@docker/actions-toolkit": "0.46.0",
|
||||
"@docker/actions-toolkit": "0.49.0",
|
||||
"handlebars": "^4.7.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -132,7 +132,12 @@ async function getBuildArgs(inputs: Inputs, context: string, toolkit: Toolkit):
|
||||
});
|
||||
if (await toolkit.buildx.versionSatisfies('>=0.8.0')) {
|
||||
await Util.asyncForEach(inputs['build-contexts'], async buildContext => {
|
||||
args.push('--build-context', buildContext);
|
||||
args.push(
|
||||
'--build-context',
|
||||
handlebars.compile(buildContext)({
|
||||
defaultContext: Context.gitContext()
|
||||
})
|
||||
);
|
||||
});
|
||||
} else if (inputs['build-contexts'].length > 0) {
|
||||
core.warning("Build contexts are only supported by buildx >= 0.8.0; the input 'build-contexts' is ignored.");
|
||||
|
@ -1,5 +1,6 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM --platform=$BUILDPLATFORM golang:alpine AS build
|
||||
|
||||
FROM --platform=$BUILDPLATFORM alpine AS build
|
||||
ARG TARGETPLATFORM
|
||||
ARG BUILDPLATFORM
|
||||
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" > /log
|
||||
@ -12,7 +13,7 @@ RUN apk --update --no-cache add \
|
||||
&& rm -rf /tmp/* /var/cache/apk/*
|
||||
|
||||
USER buildx
|
||||
RUN sudo chown buildx. /log
|
||||
RUN sudo chown buildx: /log
|
||||
USER root
|
||||
|
||||
FROM alpine
|
||||
|
10
yarn.lock
10
yarn.lock
@ -1073,9 +1073,9 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@docker/actions-toolkit@npm:0.46.0":
|
||||
version: 0.46.0
|
||||
resolution: "@docker/actions-toolkit@npm:0.46.0"
|
||||
"@docker/actions-toolkit@npm:0.49.0":
|
||||
version: 0.49.0
|
||||
resolution: "@docker/actions-toolkit@npm:0.49.0"
|
||||
dependencies:
|
||||
"@actions/artifact": ^2.1.11
|
||||
"@actions/cache": ^3.3.0
|
||||
@ -1098,7 +1098,7 @@ __metadata:
|
||||
semver: ^7.6.3
|
||||
tar-stream: ^3.1.7
|
||||
tmp: ^0.2.3
|
||||
checksum: cd34682d1b801c17c81f7f6791c4c81a69018f02413a1f7a7c2c1086bf0ee98c9afb5b44e6d5b8827df188819913eec47fa5b54b63f522b4a87c216de0b5725f
|
||||
checksum: 5e945601180002f129f095bba2d7d938b5ca69e87631d5e96a0d3b2254a8b034ab4bafbf7582ea82995e39610ad00fd68b34ab5875b9b314690328f714ad79d0
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -3161,7 +3161,7 @@ __metadata:
|
||||
resolution: "docker-build-push@workspace:."
|
||||
dependencies:
|
||||
"@actions/core": ^1.11.1
|
||||
"@docker/actions-toolkit": 0.46.0
|
||||
"@docker/actions-toolkit": 0.49.0
|
||||
"@types/node": ^20.12.12
|
||||
"@typescript-eslint/eslint-plugin": ^7.9.0
|
||||
"@typescript-eslint/parser": ^7.9.0
|
||||
|
Reference in New Issue
Block a user