File tree 3 files changed +15
-24
lines changed
3 files changed +15
-24
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "type" : " added" ,
3
+ "description" : " add support for pre-build hooks with remote docker" ,
4
+ "issues" : [928 ]
5
+ }
Original file line number Diff line number Diff line change @@ -943,7 +943,14 @@ pub(crate) fn run(
943
943
docker. arg ( "-t" ) ;
944
944
}
945
945
946
- docker. arg ( & image_name ( & options. config , target) ?) ;
946
+ let mut image = options. image_name ( ) ?;
947
+ if options. needs_custom_image ( ) {
948
+ image = options
949
+ . custom_image_build ( & paths, msg_info)
950
+ . wrap_err ( "when building custom image" ) ?;
951
+ }
952
+
953
+ docker. arg ( & image) ;
947
954
if !is_tty {
948
955
// ensure the process never exits until we stop it
949
956
// we only need this infinite loop if we don't allocate
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ impl DockerOptions {
74
74
paths : & DockerPaths ,
75
75
msg_info : & mut MessageInfo ,
76
76
) -> Result < String > {
77
- let mut image = image_name ( & self . config , & self . target ) ?;
77
+ let mut image = self . image_name ( ) ?;
78
78
79
79
if let Some ( path) = self . config . dockerfile ( & self . target ) ? {
80
80
let context = self . config . dockerfile_context ( & self . target ) ?;
@@ -167,28 +167,7 @@ impl DockerOptions {
167
167
}
168
168
169
169
pub ( crate ) fn image_name ( & self ) -> Result < String > {
170
- if let Some ( image) = self . config . image ( & self . target ) ? {
171
- return Ok ( image) ;
172
- }
173
-
174
- if !DOCKER_IMAGES . contains ( & self . target . triple ( ) ) {
175
- eyre:: bail!(
176
- "`cross` does not provide a Docker image for target {target}, \
177
- specify a custom image in `Cross.toml`.",
178
- target = self . target
179
- ) ;
180
- }
181
-
182
- let version = if include_str ! ( concat!( env!( "OUT_DIR" ) , "/commit-info.txt" ) ) . is_empty ( ) {
183
- env ! ( "CARGO_PKG_VERSION" )
184
- } else {
185
- "main"
186
- } ;
187
-
188
- Ok ( format ! (
189
- "{CROSS_IMAGE}/{target}:{version}" ,
190
- target = self . target
191
- ) )
170
+ image_name ( & self . config , & self . target )
192
171
}
193
172
}
194
173
You can’t perform that action at this time.
0 commit comments