mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-14 03:51:24 +02:00
fix: improvements on docker extra_files
This commit is contained in:
parent
c8354d5ac9
commit
bf68277b50
@ -10,7 +10,7 @@ RUN apk add --no-cache bash \
|
|||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD [ "-h" ]
|
CMD [ "-h" ]
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY scripts/entrypoint.sh /entrypoint.sh
|
||||||
COPY goreleaser /bin/goreleaser
|
|
||||||
|
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
COPY goreleaser /bin/goreleaser
|
||||||
|
@ -11,7 +11,7 @@ RUN apk add --no-cache bash \
|
|||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD [ "-h" ]
|
CMD [ "-h" ]
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY scripts/entrypoint.sh /entrypoint.sh
|
||||||
COPY goreleaser /bin/goreleaser
|
|
||||||
|
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
COPY goreleaser /bin/goreleaser
|
||||||
|
@ -138,7 +138,10 @@ func process(ctx *context.Context, docker config.Docker, bin artifact.Artifact)
|
|||||||
return errors.Wrap(err, "failed to link dockerfile")
|
return errors.Wrap(err, "failed to link dockerfile")
|
||||||
}
|
}
|
||||||
for _, file := range docker.Files {
|
for _, file := range docker.Files {
|
||||||
if err := link(file, filepath.Join(tmp, filepath.Base(file))); err != nil {
|
if err := os.MkdirAll(filepath.Join(tmp, filepath.Dir(file)), 0755); err != nil {
|
||||||
|
return errors.Wrapf(err, "failed to link extra file '%s'", file)
|
||||||
|
}
|
||||||
|
if err := link(file, filepath.Join(tmp, file)); err != nil {
|
||||||
return errors.Wrapf(err, "failed to link extra file '%s'", file)
|
return errors.Wrapf(err, "failed to link extra file '%s'", file)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,6 +76,13 @@ dockers:
|
|||||||
- "--build-arg=FOO={{.ENV.Bar}}"
|
- "--build-arg=FOO={{.ENV.Bar}}"
|
||||||
# If your Dockerfile copies files other than the binary itself,
|
# If your Dockerfile copies files other than the binary itself,
|
||||||
# you should list them here as well.
|
# you should list them here as well.
|
||||||
|
# Note that goreleaser will create the same structure inside the temporary
|
||||||
|
# folder, so if you add `foo/bar.json` here, on your Dockerfile you can
|
||||||
|
# `COPY foo/bar.json /whatever.json`.
|
||||||
|
# Also note that the paths here are relative to the folder in which
|
||||||
|
# goreleaser is being run.
|
||||||
|
# This field does not support wildcards, you can add an entire folder here
|
||||||
|
# and use wildcards when you `COPY`/`ADD` in your Dockerfile.
|
||||||
extra_files:
|
extra_files:
|
||||||
- config.yml
|
- config.yml
|
||||||
```
|
```
|
||||||
@ -159,7 +166,6 @@ This will build and publish the following images to `docker.io` and `gcr.io`:
|
|||||||
- `myuser/myimage:v1.6.4`
|
- `myuser/myimage:v1.6.4`
|
||||||
- `myuser/myimage:latest`
|
- `myuser/myimage:latest`
|
||||||
|
|
||||||
|
|
||||||
## Applying docker build flags
|
## Applying docker build flags
|
||||||
|
|
||||||
Build flags can be applied using `build_flag_templates`. The flags must be
|
Build flags can be applied using `build_flag_templates`. The flags must be
|
||||||
|
Loading…
Reference in New Issue
Block a user