[−][src]Struct dockerfile_rs::DockerFile
Dockerfile
generator
Example
use std::{io::Write, fs::File}; use dockerfile_rs::{DockerFile, Copy, FROM}; let docker_file = DockerFile::from(FROM!(nginx:latest)) .comment("open port for server") .expose(80) .copy(Copy { src: ".".to_string(), dst: ".".to_string(), from: None, chown: None, }) .cmd(vec!["echo", "Hello from container!"]); // write into file let mut file = File::create("nginx.Dockerfile")?; write!(&mut file, "{}", docker_file)?;
Methods
impl DockerFile
[src]
pub fn from(from: From) -> Self
[src]
pub fn maintainer<T: Into<Maintainer> + 'static>(self, maintainer: T) -> Self
[src]
Can be defined just once, only last function call will have effect
Deprecated, use label
with maintainer
key instead
pub fn entry_point<T: Into<EntryPoint> + 'static>(self, entry_point: T) -> Self
[src]
Can be defined just once, only last function call will have effect
pub fn cmd<T: Into<Cmd> + 'static>(self, cmd: T) -> Self
[src]
Can be defined just once, only last function call will have effect
pub fn run<T: Into<Run> + 'static>(self, run: T) -> Self
[src]
pub fn label<T: Into<Label> + 'static>(self, label: T) -> Self
[src]
pub fn expose<T: Into<Expose> + 'static>(self, expose: T) -> Self
[src]
pub fn env<T: Into<Env> + 'static>(self, env: T) -> Self
[src]
pub fn add(self, add: Add) -> Self
[src]
pub fn copy(self, copy: Copy) -> Self
[src]
pub fn volume<T: Into<Volume> + 'static>(self, volume: T) -> Self
[src]
pub fn user(self, user: User) -> Self
[src]
pub fn work_dir<T: Into<WorkDir> + 'static>(self, work_dir: T) -> Self
[src]
pub fn arg<T: Into<Arg> + 'static>(self, arg: T) -> Self
[src]
pub fn stop_signal<T: Into<StopSignal> + 'static>(self, stop_signal: T) -> Self
[src]
pub fn health_check(self, health_check: HealthCheck) -> Self
[src]
pub fn shell<T: Into<Shell> + 'static>(self, shell: T) -> Self
[src]
pub fn comment<T: Into<Comment> + 'static>(self, comment: T) -> Self
[src]
pub fn on_build<T: Into<OnBuild> + 'static>(self, on_build: T) -> Self
[src]
Trait Implementations
Auto Trait Implementations
impl !Send for DockerFile
impl !Sync for DockerFile
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,