pub fn build(
        &self,
        opts: &BuildOptions,
    ) -> impl Stream<Item = Result<Value>> + Unpin + 'docker {
        let mut endpoint = vec!["/build".to_owned()];
        if let Some(query) = opts.serialize() {
            endpoint.push(query)
        }

        // To not tie the lifetime of `opts` to the 'stream, we do the tarring work outside of the
        // stream. But for backwards compatability, we have to return the error inside of the
        // stream.
        let mut bytes = Vec::default();
        let tar_result = tarball::dir(&mut bytes, opts.path.as_str());

        // We must take ownership of the Docker reference. If we don't then the lifetime of 'stream
        // is incorrectly tied to `self`.
        let docker = self.docker;
        Box::pin(
            async move {
                // Bubble up error inside the stream for backwards compatability
                tar_result?;

                let value_stream = docker.stream_post_into_values(
                    endpoint.join("?"),
                    Some((Body::from(bytes), tar())),
                    None::<iter::Empty<_>>,
                );

                Ok(value_stream)
            }
            .try_flatten_stream(),
        )
    }
/// Builds a new image build by reading a Dockerfile in a target directory
Builds a new image build by reading a Dockerfile in a target directory
Builds a new image build by reading a Dockerfile in a target directory
pub fn build(
        &self,
        opts: &BuildOptions,
    ) -> impl Stream<Item = Result<Value>> + Unpin + 'docker {
        let mut endpoint = vec!["/build".to_owned()];
        if let Some(query) = opts.serialize() {
            endpoint.push(query)
        }
        // To not tie the lifetime of `opts` to the 'stream, we do the tarring work outside of the
        // stream. But for backwards compatability, we have to return the error inside of the
        // stream.
        let mut bytes = Vec::default();
        let tar_result = tarball::dir(&mut bytes, opts.path.as_str());
        // We must take ownership of the Docker reference. If we don't then the lifetime of 'stream
        // is incorrectly tied to `self`.
        let docker = self.docker;
        Box::pin(
            async move {
                // Bubble up error inside the stream for backwards compatability
                tar_result?;
                let value_stream = docker.stream_post_into_values(
                    endpoint.join("?"),
                    Some((Body::from(bytes), tar())),
                    None::<iter::Empty<_>>,
                );
                Ok(value_stream)
            }
            .try_flatten_stream(),
        )
    }
pub fn build ( & self , opts : & BuildOptions , ) -> impl Stream < Item = Result < Value > > + Unpin + ' docker { let mut endpoint = vec ! [ " " to_owned ( ) ] ; if let Some ( query ) = opts . serialize ( ) { endpoint . push ( query ) } // To not tie the lifetime of `opts` to the 'stream, we do the tarring work outside of the // stream. But for backwards compatability, we have to return the error inside of the // stream. let mut bytes = Vec :: default ( ) ; let tar_result = tarball :: dir ( & mut bytes , opts . path . as_str ( ) ) ; // We must take ownership of the Docker reference. If we don't then the lifetime of 'stream // is incorrectly tied to `self`. let docker = self . docker ; Box :: pin ( async move { // Bubble up error inside the stream for backwards compatability tar_result ? ; let value_stream = docker . stream_post_into_values ( endpoint . join ( " " ) , Some ( ( Body :: from ( bytes ) , tar ( ) ) ) , None :: < iter :: Empty < _ > > , ) ; Ok ( value_stream ) } . try_flatten_stream ( ) , ) }
Builds a new image build by reading a Dockerfile in a target directory
Builds a new image build by reading a Dockerfile in a target directory
&self
opts
&BuildOptions
&self
opts
&BuildOptions