[][src]Struct dockerfile_rs::DockerFile

pub struct DockerFile { /* fields omitted */ }

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

impl Display for DockerFile[src]

Auto Trait Implementations

impl !Send for DockerFile

impl !Sync for DockerFile

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]