Skip to content

Commit 9200adf

Browse files
Dockerfile.windows: escape quotes properly for GO_TAGS environment variable (#763) (#815)
* Dockerfile.windows: escape quotes Using single quotes led to recursive variable definitions in Make, while double quotes caused the build to fail. To work around this, escaped double quotes must be used. * ci: add test to build Docker images (cherry picked from commit 577ea1f) Co-authored-by: Robert Fratto <robertfratto@gmail.com>
1 parent 69bafef commit 9200adf

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Check Docker images
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- Dockerfile
7+
- Dockerfile.windows
8+
- Makefile
9+
- 'tools/make/*'
10+
11+
jobs:
12+
# NOTE(rfratto): We only test building the Docker images for the host
13+
# platform, but we're really only looking for issues that are
14+
# architecture-independent.
15+
linux:
16+
runs-on: ubuntu-22.04
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Build image
20+
run: |
21+
docker build -t alloy-test:latest -f Dockerfile .
22+
23+
windows:
24+
runs-on: windows-2019
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: Build image
28+
run: |
29+
docker build -t alloy-test:latest -f Dockerfile.windows .
30+
31+

Dockerfile.windows

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ SHELL ["cmd", "/S", "/C"]
1212
# we can before moving on to the next step.
1313
RUN ""C:\Program Files\git\bin\bash.exe" -c "RELEASE_BUILD=${RELEASE_BUILD} VERSION=${VERSION} make generate-ui && rm -rf web/ui/node_modules && yarn cache clean --all""
1414

15-
RUN ""C:\Program Files\git\bin\bash.exe" -c "RELEASE_BUILD=${RELEASE_BUILD} VERSION=${VERSION} GO_TAGS='builtinassets ${GO_TAGS}' make alloy""
15+
RUN ""C:\Program Files\git\bin\bash.exe" -c "RELEASE_BUILD=${RELEASE_BUILD} VERSION=${VERSION} GO_TAGS=\"builtinassets ${GO_TAGS}\" make alloy""
1616
# In this case, we're separating the clean command from make alloy to avoid an issue where access to some mod cache
1717
# files is denied immediately after make alloy, for example:
1818
# "go: remove C:\go\pkg\mod\golang.org\toolchain@v0.0.1-go1.22.3.windows-amd64\bin\go.exe: Access is denied."

0 commit comments

Comments
 (0)